bug-global
[Top][All Lists]
Advanced

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

gtags under win32


From: Mikolaj Sitarz
Subject: gtags under win32
Date: Sat, 1 Aug 2009 21:37:26 +0200

Hi,

Few days ago I have sent a question on help-global,  regarding "-f"
option on windows. I was
always getting "Warning: '...path here...' is out of source tree.
(Ignored)"  message when trying use gtags with "-f".
Now I know the purpose of that behavior.  It occurs when the root
directory consists only of a drive letter. Then its sometimes "c:" and
sometimes "c:/". Therefore comparing the paths like "c:/adir" and
"c://adir" failed.
The solution is included in the patch at the end of email.

Patch also contains solution to my second problem. I have dir with
sources mounted over network as a drive letter. When connection
temporary fails - which happens very often - I am getting message
"command failed in xargs_read()" and process exit. Its because of
error on closing the pipe. So I included conditional ignoring error
(based on flag IGNORE_ERROR). Now I can use global which unbelievable
speeds up my work!
Thanks a lot for such great package!


Regards
Mikolaj Sitarz


diff -ru global-5.7.5/libutil/find.c global-5.7.5a/libutil/find.c
--- global-5.7.5/libutil/find.c 2009-03-14 01:30:37.000000000 +0100
+++ global-5.7.5a/libutil/find.c        2009-08-01 16:02:17.000000000 +0200
@@ -477,8 +477,19 @@
         */
        if (!strcmp(root, "/"))
                strlimcpy(rootdir, root, sizeof(rootdir));
-       else
-               snprintf(rootdir, sizeof(rootdir), "%s/", root);
+       else {
+#if defined(_WIN32) || defined(__DJGPP__)
+         /*
+          * on windows its sometimes 'C:', sometimes 'C:/'
+          */
+         if(strlen(root) >= 1 && root[strlen(root)-1] == '/')
+           snprintf(rootdir, sizeof(rootdir), "%s", root);
+         else
+           snprintf(rootdir, sizeof(rootdir), "%s/", root);
+#else
+           snprintf(rootdir, sizeof(rootdir), "%s/", root);
+#endif
+       }
        strlimcpy(cwddir, root, sizeof(cwddir));
        /*
         * prepare regular expressions.
diff -ru global-5.7.5/libutil/xargs.c global-5.7.5a/libutil/xargs.c
--- global-5.7.5/libutil/xargs.c        2009-03-14 01:30:37.000000000 +0100
+++ global-5.7.5a/libutil/xargs.c       2009-08-01 16:05:11.000000000 +0200
@@ -283,7 +283,12 @@
         * was not found. If you would like to use such command, set the
         * flag to 1.
         */
+#ifdef IGNORE_ERROR
+       xp->ignore_error = 1;
+#else
        xp->ignore_error = 0;
+#endif
+
        /*
         * By default, we doesn't put the path to GPATH.
         * This option is prepared for createtags() and updatetags().




reply via email to

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