[Top][All Lists]

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

Re: [h-e-w] Patch to Gnuserv for NT

From: Guy Gascoigne - Piggford
Subject: Re: [h-e-w] Patch to Gnuserv for NT
Date: Fri, 21 Jan 2005 12:37:41 -0800
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

To be honest I think that something like this is better handled as a command line option disabling the expansion.

Your fix works on cygwin because cygwin dispenses with the concept of separate drive mappings and creates mounts for all of the drives. This means that all paths can be resolved from a root path. Something like the MKS Toolkit shell keeps separate drive identifiers, so if you try to open /foo and do no expansion then you'll end out opening /foo from the current drive or the emacs process rather than the current drive of gnuclient, I rather like to fix this in such a way that both systems can work correctly.

Rather than a command line option (since I'm blocking on coming up with a good option flag right now), we could just detect whether the environment variable $CYGWIN is set and if it is just skip expansion. I'm just not sure what other environments might need this sort of function.


Ismael Valladolid Torres wrote:

I just downloaded from [1]here. This is Guy Gascoigne's
version of Gnuserv for NT, the one with Internet socket support. I use
NT Emacs and Cygwin, and require cygwin-mount in my .emacs. I just
noticed that, when running gnuclientw from the command line, any
argument that is a UNIX path is expanded incorrectly, so the file is
not opened.

I attach you a simple patch to gnuclient.c that disallows path
expansion when argument is a UNIX path, so cygwin-mount can take care
of it. I hope anybody find it useful.

Cordially, Ismael


--- gnuclient.c.orig    1999-09-11 23:37:24.000000000 +0200
+++ gnuclient.c 2005-01-21 10:13:47.761252000 +0100
@@ -58,6 +58,12 @@
        WIN32_FIND_DATA finddata;
        HANDLE handle;

+       // If filename given is a Cygwin path, don't expand filename
+       if (filename[0] == '/') {
+               strcpy (fullpath, filename);
+               return (TRUE);
+       }
        if (!GetFullPathName (filename, MAXPATHLEN + 2, fullpath, &fname)) {
                fprintf (stderr, "Unable to get full pathname for %s\n", 
                return (FALSE);

reply via email to

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