Fixed a typo resulting in absolute cases not being picked up well.

Index: src/file.c
==================================================================
--- src/file.c
+++ src/file.c
@@ -327,24 +327,30 @@
 ** zFilename is a directory -OR- a symlink that points to a directory.
 ** Return 0 if zFilename does not exist.  Return 2 if zFilename exists
 ** but is something other than a directory.
 */
 int file_wd_isdir(const char *zFilename){
-  int rc;
+  int rc, nFN;
   char *zFN;


   zFN = mprintf("%s", zFilename);
-  file_simplify_name(zFN, -1, 0);
+  nFN = file_simplify_name(zFN, -1, 0);
   rc = getStat(zFN, 1);
   if( rc ){
     rc = 0; /* It does not exist at all. */
   }else if( S_ISDIR(fileStat.st_mode) ){
     rc = 1; /* It exists and is a real directory. */
   }else if( S_ISLNK(fileStat.st_mode) ){
     Blob content;
+    char *zFullName;
     blob_read_link(&content, zFN); /* It exists and is a link. */
-    rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */
+    if(*blob_str(&content) != '/') {
+      while( nFN>0 && zFN[nFN-1]!='/' ){ nFN--; }
+    } else { nFN = 0; }
+    zFullName = mprintf("%.*s%s", nFN, zFN, blob_str(&content));
+    rc = file_wd_isdir(zFullName); /* Points to directory? */
+    free(zFullName);
     blob_reset(&content);
   }else{
     rc = 2; /* It exists and is something else. */
   }
   free(zFN);
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to