diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2009-03-11 00:57:03 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2009-03-11 00:57:03 +0000 |
commit | 6cde1b21385d450f73b889deee4e11211b0036ec (patch) | |
tree | 7cff2a3426091145f2c6d8e2b5a476b2fe1ca003 /lib-src | |
parent | 7679cfc8a436185e2ad95c7f6a900d1431714434 (diff) | |
download | emacs-6cde1b21385d450f73b889deee4e11211b0036ec.tar.gz |
* emacsclient.c (main): Revert part of last change,
so drive-relative file names again work on Windows.
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/ChangeLog | 5 | ||||
-rw-r--r-- | lib-src/emacsclient.c | 20 |
2 files changed, 25 insertions, 0 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 0609f1e1e10..c9c37ed76ff 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,10 @@ 2009-03-10 Stefan Monnier <monnier@iro.umontreal.ca> + * emacsclient.c (main): Revert part of last change, so + drive-relative file names again work on Windows. + +2009-03-10 Stefan Monnier <monnier@iro.umontreal.ca> + * emacsclient.c (main): Always pass cwd via "-dir". Pass the file names without prepending cwd to them, so Emacs uses its customary rules to determine how to interpret the file name. diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 3197b2a7276..f66d6b4cd25 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1635,6 +1635,26 @@ main (argc, argv) continue; } } +#ifdef WINDOWSNT + else if (! file_name_absolute_p (argv[i]) + && (isalpha (argv[i][0]) && argv[i][1] == ':')) + /* Windows can have a different default directory for each + drive, so the cwd passed via "-dir" is not sufficient + to account for that. + If the user uses <drive>:<relpath>, we hence need to be + careful to expand <relpath> with the default directory + corresponding to <drive>. */ + { + char *filename = (char *) xmalloc (MAX_PATH); + DWORD size; + + size = GetFullPathName (argv[i], MAX_PATH, filename, NULL); + if (size > 0 && size < MAX_PATH) + argv[i] = filename; + else + free (filename); + } +#endif send_to_emacs (emacs_socket, "-file "); quote_argument (emacs_socket, argv[i]); |