texinfo-commits
[Top][All Lists]
Advanced

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

[5993] Avoid duplicate directories and files on MS-Windows.


From: Eli Zaretskii
Subject: [5993] Avoid duplicate directories and files on MS-Windows.
Date: Fri, 26 Dec 2014 10:54:35 +0000

Revision: 5993
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5993
Author:   eliz
Date:     2014-12-26 10:54:34 +0000 (Fri, 26 Dec 2014)
Log Message:
-----------
Avoid duplicate directories and files on MS-Windows.

 info/info-utils.c (fncmp) [__MSDOS__ || __MINGW32__]: Now
 external.  Move the #define for Posix hosts ...
 info/info-utils.h (fncmp): ...to here.  Declare a prototype for
 __MSDOS__ and __MINGW32__.
 info/infopath.c (infopath_add_dir): If the inode values are
 zero, use file-name comparison as fallback.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/info-utils.c
    trunk/info/info-utils.h
    trunk/info/infopath.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-12-26 08:47:30 UTC (rev 5992)
+++ trunk/ChangeLog     2014-12-26 10:54:34 UTC (rev 5993)
@@ -1,3 +1,14 @@
+2014-12-26  Eli Zaretskii  <address@hidden>
+
+       * info/info-utils.c (fncmp) [__MSDOS__ || __MINGW32__]: Now
+       external.  Move the #define for Posix hosts ...
+
+       * info/info-utils.h (fncmp): ...to here.  Declare a prototype for
+       __MSDOS__ and __MINGW32__.
+
+       * info/infopath.c (infopath_add_dir): If the inode values are
+       zero, use file-name comparison as fallback.
+
 2014-12-25  Gavin Smith  <address@hidden>
 
        * info/search.c (find_node_separator, skip_node_separator): 

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2014-12-26 08:47:30 UTC (rev 5992)
+++ trunk/info/info-utils.c     2014-12-26 10:54:34 UTC (rev 5993)
@@ -2021,7 +2021,7 @@
 #if defined(__MSDOS__) || defined(__MINGW32__)
 /* Cannot use FILENAME_CMP here, since that does not consider forward-
    and back-slash characters equal.  */
-static int
+int
 fncmp (const char *fn1, const char *fn2)
 {
   const char *s1 = fn1, *s2 = fn2;
@@ -2037,8 +2037,6 @@
 
   return tolower (*s1) - tolower (*s2);
 }
-#else
-# define fncmp(s,t) strcmp(s,t)
 #endif
 
 struct info_namelist_entry

Modified: trunk/info/info-utils.h
===================================================================
--- trunk/info/info-utils.h     2014-12-26 08:47:30 UTC (rev 5992)
+++ trunk/info/info-utils.h     2014-12-26 10:54:34 UTC (rev 5993)
@@ -142,4 +142,10 @@
 int info_namelist_add (struct info_namelist_entry **ptop, const char *name);
 void info_namelist_free (struct info_namelist_entry *top);
 
+#if defined(__MSDOS__) || defined(__MINGW32__)
+int fncmp (const char *fn1, const char *fn2);
+#else
+# define fncmp(s,t) strcmp(s,t)
+#endif
+
 #endif /* not INFO_UTILS_H */

Modified: trunk/info/infopath.c
===================================================================
--- trunk/info/infopath.c       2014-12-26 08:47:30 UTC (rev 5992)
+++ trunk/info/infopath.c       2014-12-26 10:54:34 UTC (rev 5993)
@@ -173,8 +173,8 @@
       if (   dirinfo.st_ino == infodirs[i]->inode
           && dirinfo.st_dev == infodirs[i]->device
           /* On MS-Windows, `stat' returns zero as the inode, so we
-             effectively disable this optimization for that OS.  */
-          && infodirs[i]->inode != 0)
+             use file-name comparison instead for that OS.  */
+          && (infodirs[i]->inode != 0 || fncmp (path, infodirs[i]->name) == 0))
         {
           debug (2, ("duplicate directory %s not added to INFOPATH", path));
           free (path);




reply via email to

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