bugfix: global.exe for win32 abnormal behaviour.

> I'm currently confused about how to build gnu global on windows.

Install MinGW and msys.  Start msys.bat.  cd to where you've installed
global (note that msys uses "/c/path" for "C:\path").  Run
"./configure --disable-shared --disable-dependency-tracking" and wait a
bit.  Run "make" and wait a bit.  You'll now have all the exes in their
individual directories, so run "make prefix=/c/where/to/install install"
to copy everything (and then "strip /c/where/to/install/bin/*.exe" to
reduce their size) or just "strip global/global.exe; cp global/global.exe
/c/where/to/install/bin".  Alternatively, I've put up the new global on
my SkyDrive (which also fixes --single-update; patch sent to bug-global).

https://skydrive.live.com/#cid=0D18DE9C2F9D17ED&id=D18DE9C2F9D17ED!111

On 18/06/2013 20:12, yun sheng wrote:
> This happens to be a bug specifically using the Win32 version.
> `global --single-update "t.c"`
> won't refresh the gtags database correctly, it gives an error:
> `The filename, directory name, or volume lable syntax is incorrect.`

Dumb CMD.EXE (and dumb me for not testing it).  Here's the fix:

--- global~.c   2013-02-28 21:21:06.000000000 +1000
+++ global.c    2013-06-19 17:31:05.578758100 +1000
@@ -633,6 +633,13 @@
                        die("gtags command not found.");
                if (chdir(root) < 0)
                        die("cannot change directory to '%s'.", root);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+               /*
+                * Get around CMD.EXE's weird quoting rules by sticking another
+                * perceived whitespace in front (also works with Take Command).
+                */
+               strbuf_putc(sb, ';');
+#endif
                strbuf_puts(sb, quote_shell(gtags_path));
                strbuf_puts(sb, " -i");
                if (vflag)

THIS SHOULD BE DONE LATER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Hello,
I have recognized reappearance of the bug in my UNIX too.
I have made a patch to fix it. It works well in my UNIX.
If possible, would you please try the patch?
It will be included in the next release.

Thank you for your report.

Index: global.c
===================================================================
RCS file: /sources/global/global/global/global.c,v
retrieving revision 1.268
diff -c -r1.268 global.c
*** global.c    8 Feb 2013 05:28:58 -0000       1.268
--- global.c    19 Jun 2013 01:09:27 -0000
***************
*** 645,657 ****
                                        die("rel2abs failed.");
                                single_update = regular_path_name;
                        }
!                       strbuf_puts(sb, " --single-update=");
!                       strbuf_putc(sb, '"');
!                       strbuf_puts(sb, single_update);
!                       strbuf_putc(sb, '"');
                }
                strbuf_putc(sb, ' ');
!               strbuf_puts(sb, dbpath);
                if (system(strbuf_value(sb)))
                        exit(1);
                strbuf_close(sb);
--- 645,656 ----
                                        die("rel2abs failed.");
                                single_update = regular_path_name;
                        }
!                       strbuf_puts(sb, " --single-update");
!                       strbuf_putc(sb, ' ');
!                       strbuf_puts(sb, quote_shell(single_update));
                }
                strbuf_putc(sb, ' ');
!               strbuf_puts(sb, quote_shell(dbpath));
                if (system(strbuf_value(sb)))
                        exit(1);
                strbuf_close(sb);

On Tue, 18 Jun 2013 18:17:14 +0800
yun sheng <uewing@gmail.com> wrote:

> What is your environment(OS)?
> Windows XP SP3
>
> Which version of GLOBAL are you using?
> GLOBAL 6.2.8 Win32
>
> What did you do? (command line)
> 1, generate gtags for a project which path contains spaces
>     C:\sheng yun\project
> 2, run global -u
>
> What did you expect from it?
> The gtags database should be updated.
>
> What was occurred?
> the database was not updated because of the spaces in the path.
> And the following error occured:
>
> `gtags: directory 'c:/sheng' not found.`
>
>
> Best regards,
> Sheng Yun
>