dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/cscc/common cc_compat.c,1.2,1.3


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/common cc_compat.c,1.2,1.3
Date: Sat, 13 Sep 2003 01:07:02 -0400

Update of /cvsroot/dotgnu-pnet/pnet/cscc/common
In directory subversions:/tmp/cvs-serv21228/cscc/common

Modified Files:
        cc_compat.c 
Log Message:


Be careful not to treat absolute pathnames as options in compat mode.


Index: cc_compat.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/common/cc_compat.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** cc_compat.c 8 Jul 2003 10:14:38 -0000       1.2
--- cc_compat.c 13 Sep 2003 05:06:59 -0000      1.3
***************
*** 582,585 ****
--- 582,607 ----
  
  /*
+  * Determine if a string starting with '/' looks like an absolute
+  * Unix-style pathname.
+  */
+ static int LooksLikeAbsolutePath(const char *str)
+ {
+       ++str;
+       while(*str != '\0')
+       {
+               if(*str == '/')
+               {
+                       return 1;
+               }
+               else if(*str == ':' || *str == '=')
+               {
+                       break;
+               }
+               ++str;
+       }
+       return 0;
+ }
+ 
+ /*
   * Parse the command-line options with the compatibility parser.
   */
***************
*** 595,598 ****
--- 617,625 ----
                   is a source input file */
                if(argv[posn][0] != '-' && argv[posn][0] != '/')
+               {
+                       CCStringListAdd(&input_files, &num_input_files, 
argv[posn]);
+                       continue;
+               }
+               if(argv[posn][0] == '/' && LooksLikeAbsolutePath(argv[posn]))
                {
                        CCStringListAdd(&input_files, &num_input_files, 
argv[posn]);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]