[ros-diffs] [tkreuzer] 49693: [SPEC2DEF] Fix handling of redirections

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sun Nov 21 17:23:40 UTC 2010


Author: tkreuzer
Date: Sun Nov 21 17:23:40 2010
New Revision: 49693

URL: http://svn.reactos.org/svn/reactos?rev=49693&view=rev
Log:
[SPEC2DEF]
Fix handling of redirections

Modified:
    branches/cmake-bringup/tools/spec2def/spec2def.c

Modified: branches/cmake-bringup/tools/spec2def/spec2def.c
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/tools/spec2def/spec2def.c?rev=49693&r1=49692&r2=49693&view=diff
==============================================================================
--- branches/cmake-bringup/tools/spec2def/spec2def.c [iso-8859-1] (original)
+++ branches/cmake-bringup/tools/spec2def/spec2def.c [iso-8859-1] Sun Nov 21 17:23:40 2010
@@ -58,6 +58,16 @@
     return 1;
 }
 
+int
+ScanToken(const char *token, char chr)
+{
+    while (!IsSeparator(*token))
+    {
+        if (*token++ == chr) return 1;
+    }
+    return 0;
+}
+
 char *
 NextLine(char *pc)
 {
@@ -165,13 +175,23 @@
 
     if (exp->pcRedirection && !no_redirections)
     {
-        if (exp->nCallingConvention == CC_FASTCALL && !no_decoration)
+        int bAddDecorations = 1;
+
+        fprintf(fileDest, "=");
+        
+        /* No decorations, if switch was passed or this is an external */
+        if (no_decoration || ScanToken(exp->pcRedirection, '.'))
+        {
+            bAddDecorations = 0;
+        }
+        
+        if (exp->nCallingConvention == CC_FASTCALL && bAddDecorations)
         {
             fprintf(fileDest, "@");
         }
-        fprintf(fileDest, "=%.*s", exp->nRedirectionLength, exp->pcRedirection);
+        fprintf(fileDest, "%.*s", exp->nRedirectionLength, exp->pcRedirection);
         if ((exp->nCallingConvention == CC_STDCALL || 
-            exp->nCallingConvention == CC_FASTCALL) && !no_decoration)
+            exp->nCallingConvention == CC_FASTCALL) && bAddDecorations)
         {
             fprintf(fileDest, "@%d", exp->nStackBytes);
         }




More information about the Ros-diffs mailing list