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_options.c,1.7,1.8 cc_opt


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/cscc/common cc_options.c,1.7,1.8 cc_options.h,1.5,1.6
Date: Tue, 17 Dec 2002 00:36:08 -0500

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

Modified Files:
        cc_options.c cc_options.h 
Log Message:


Look for plugins in install-relative locations.



Index: cc_options.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/common/cc_options.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** cc_options.c        10 Dec 2002 23:26:26 -0000      1.7
--- cc_options.c        17 Dec 2002 05:36:05 -0000      1.8
***************
*** 129,139 ****
  }
  
! void CCAddPathStrings(char ***list, int *num, char *path)
  {
!       int len;
        char *newstr;
        while(*path != '\0')
        {
!               if(*path == ' ' || *path == ':')
                {
                        ++path;
--- 129,189 ----
  }
  
! void CCAddPathStrings(char ***list, int *num, char *path,
!                                         char *standard1, char *standard2)
  {
!       int len, separator;
        char *newstr;
+ 
+       /* Add the standard paths, derived from the install location */
+       if(standard1)
+       {
+               if(!CCStringListContains(*list, *num, standard1) &&
+                  DirExists(standard1))
+               {
+                       AddString(list, num, standard1);
+               }
+       }
+       if(standard2)
+       {
+               if(!CCStringListContains(*list, *num, standard2) &&
+                  DirExists(standard2))
+               {
+                       AddString(list, num, standard2);
+               }
+       }
+ 
+       /* Attempt to discover the correct path separator to use */
+ #ifdef IL_WIN32_PLATFORM
+       if(strchr(path, ';') != 0)
+       {
+               /* The path already uses ';', so that is probably the separator 
*/
+               separator = ';';
+       }
+       else
+       {
+               /* Deal with the ambiguity between ':' used as a separator
+                  and ':' used to specify a drive letter */
+               if(((path[0] >= 'A' && path[0] <= 'Z') ||
+                   (path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':')
+               {
+                       /* The path is probably one directory, starting
+                          with a drive letter */
+                       separator = ';';
+               }
+               else
+               {
+                       /* The path is probably Cygwin-like, using ':' to 
separate */
+                       separator = ':';
+               }
+       }
+ #else
+       separator = ':';
+ #endif
+ 
+       /* Split the path into separate components */
        while(*path != '\0')
        {
!               if(*path == separator || *path == ' ' || *path == '\t' ||
!                  *path == '\r' || *path == '\n')
                {
                        ++path;
***************
*** 141,149 ****
                }
                len = 1;
!               while(path[len] != '\0' && path[len] != ':')
                {
                        ++len;
                }
!               while(len > 0 && path[len - 1] == ' ')
                {
                        --len;
--- 191,200 ----
                }
                len = 1;
!               while(path[len] != '\0' && path[len] != separator)
                {
                        ++len;
                }
!               while(len > 0 && (path[len - 1] == ' ' || path[len - 1] == '\t' 
||
!                                                 path[len - 1] == '\r' || 
path[len - 1] == '\n'))
                {
                        --len;

Index: cc_options.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/common/cc_options.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** cc_options.h        10 Dec 2002 23:26:26 -0000      1.5
--- cc_options.h        17 Dec 2002 05:36:05 -0000      1.6
***************
*** 115,119 ****
   * Add a path to a list of strings.
   */
! void CCAddPathStrings(char ***list, int *num, char *path);
  
  /*
--- 115,120 ----
   * Add a path to a list of strings.
   */
! void CCAddPathStrings(char ***list, int *num, char *path,
!                                         char *standard1, char *standard2);
  
  /*




reply via email to

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