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

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

[Dotgnu-pnet-commits] pnet/image link.c,1.29,1.30


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnet/image link.c,1.29,1.30
Date: Mon, 10 Nov 2003 06:34:25 +0000

Update of /cvsroot/dotgnu-pnet/pnet/image
In directory subversions:/tmp/cvs-serv7846/image

Modified Files:
        link.c 
Log Message:


Look in a version-specific sub-directory before looking in the main
directory during assembly resolution.


Index: link.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/link.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** link.c      10 Nov 2003 05:14:44 -0000      1.29
--- link.c      10 Nov 2003 06:34:23 -0000      1.30
***************
*** 389,418 ****
  static int FindAssemblyInPaths(const char **paths, unsigned long numPaths,
                                                           const char *name, 
int namelen, int isSystem,
!                                                          char **path, char 
**firstPath)
  {
        unsigned long posn;
        for(posn = 0; posn < numPaths; ++posn)
        {
                *path = TestPathForFile(paths[posn], strlen(paths[posn]),
!                                                           name, namelen, 0, 
".dll", 0, 0);
                if(*path)
                {
!                       if(!isSystem ||
!                          TestPathForPnetlibHere(paths[posn], 
strlen(paths[posn])))
                        {
-                               if(*firstPath)
-                               {
-                                       ILFree(*firstPath);
-                               }
                                return 1;
                        }
-                       if(*firstPath)
-                       {
-                               ILFree(*path);
-                       }
-                       else
-                       {
-                               *firstPath = *path;
-                       }
                }
        }
--- 389,428 ----
  static int FindAssemblyInPaths(const char **paths, unsigned long numPaths,
                                                           const char *name, 
int namelen, int isSystem,
!                                                          char **path, char 
**firstPath,
!                                                          const ILUInt16 
*version)
  {
        unsigned long posn;
+       char versionBuffer[64];
+       const char *versionPrefix;
+       if(version && (version[0] != 0 || version[1] != 0 ||
+                                  version[2] != 0 || version[3] != 0))
+       {
+               sprintf(versionBuffer, "%d.%d.%d.%d/",
+                               (int)(version[0]), (int)(version[1]),
+                               (int)(version[2]), (int)(version[3]));
+               versionPrefix = versionBuffer;
+       }
+       else
+       {
+               versionBuffer[0] = '\0';
+               versionPrefix = 0;
+       }
        for(posn = 0; posn < numPaths; ++posn)
        {
                *path = TestPathForFile(paths[posn], strlen(paths[posn]),
!                                                           name, namelen, 
versionPrefix, ".dll", 0, 0);
                if(*path)
                {
!                       return 1;
!               }
!               if(versionPrefix)
!               {
!                       /* Retry without the version directory prefix */
!                       *path = TestPathForFile(paths[posn], 
strlen(paths[posn]),
!                                                                   name, 
namelen, 0, ".dll", 0, 0);
!                       if(*path)
                        {
                                return 1;
                        }
                }
        }
***************
*** 468,472 ****
        /* Search the before path list */
        if(FindAssemblyInPaths(beforePaths, numBeforePaths, name, namelen,
!                                                  isSystem, &path, &firstPath))
        {
                return path;
--- 478,482 ----
        /* Search the before path list */
        if(FindAssemblyInPaths(beforePaths, numBeforePaths, name, namelen,
!                                                  isSystem, &path, &firstPath, 
version))
        {
                return path;
***************
*** 479,483 ****
                if(FindAssemblyInPaths((const char **)importantSystemPath,
                                                           (unsigned 
long)importantSystemPathSize,
!                                                          name, namelen, 
isSystem, &path, &firstPath))
                {
                        return path;
--- 489,494 ----
                if(FindAssemblyInPaths((const char **)importantSystemPath,
                                                           (unsigned 
long)importantSystemPathSize,
!                                                          name, namelen, 
isSystem, &path, &firstPath,
!                                                          version))
                {
                        return path;
***************
*** 524,528 ****
                if(FindAssemblyInPaths((const char **)systemPath,
                                                           (unsigned 
long)systemPathSize, name, namelen,
!                                                          isSystem, &path, 
&firstPath))
                {
                        return path;
--- 535,539 ----
                if(FindAssemblyInPaths((const char **)systemPath,
                                                           (unsigned 
long)systemPathSize, name, namelen,
!                                                          isSystem, &path, 
&firstPath, version))
                {
                        return path;
***************
*** 532,536 ****
        /* Search the after path list */
        if(FindAssemblyInPaths(afterPaths, numAfterPaths, name, namelen,
!                                                  isSystem, &path, &firstPath))
        {
                return path;
--- 543,547 ----
        /* Search the after path list */
        if(FindAssemblyInPaths(afterPaths, numAfterPaths, name, namelen,
!                                                  isSystem, &path, &firstPath, 
version))
        {
                return path;





reply via email to

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