help-global
[Top][All Lists]
Advanced

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

patch: global -u on win32 with src root at drive root


From: Kai Tetzlaff
Subject: patch: global -u on win32 with src root at drive root
Date: Sun, 18 Oct 2009 21:00:05 +0200
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Hi,

i compiled global on win32 and tried it with a source tree which starts
directly at the drive level (root='D:'). In this case the chdir which
takes care that the search in 'global -u' starts at the root of the src
tree does not work on windows if there's no '/' at the end of the path.
If you change root='D:' to root='D:/' its working. So i changed
chdir(root) to chdir(get_root_with_slash()) in order to fix this. I
don't think this will cause problems for unix systems.

Could you consider adding the attached patch to the global sources?

BR,
Kai
? depcomp
? install-sh
? missing
? w32_root_drv.patch
? doc/mdate-sh
Index: global/global.c
===================================================================
RCS file: /sources/global/global/global/global.c,v
retrieving revision 1.198
diff -u -w -r1.198 global.c
--- global/global.c     29 Jan 2009 09:30:09 -0000      1.198
+++ global/global.c     18 Oct 2009 18:51:30 -0000
@@ -430,7 +430,7 @@
 
                if (!gtags)
                        die("gtags command not found.");
-               if (chdir(root) < 0)
+               if (chdir(get_root_with_slash()) < 0)
                        die("cannot change directory to '%s'.", root);
                strbuf_puts(sb, gtags);
                strbuf_puts(sb, " -i");
@@ -509,21 +509,21 @@
         * exec lid(idutils).
         */
        if (Iflag) {
-               chdir(root);
+               chdir(get_root_with_slash());
                idutils(av, dbpath);
        }
        /*
         * search pattern (regular expression).
         */
        else if (gflag) {
-               chdir(root);
+               chdir(get_root_with_slash());
                grep(av, dbpath);
        }
        /*
         * locate paths including the pattern.
         */
        else if (Pflag) {
-               chdir(root);
+               chdir(get_root_with_slash());
                pathlist(av, dbpath);
        }
        /*
@@ -937,7 +937,7 @@
                /*
                 * Execute parser in the root directory of source tree.
                 */
-               if (chdir(root) < 0)
+               if (chdir(get_root_with_slash()) < 0)
                        die("cannot move to '%s' directory.", root);
                xp = xargs_open_with_strbuf(strbuf_value(comline), 0, 
path_list);
                if (format == FORMAT_PATH) {

reply via email to

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