X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib-src%2Fgnuclient.c;h=4ed986d21a1586f753ed84b6b01a94bcd287b433;hb=efdb31fd4c8db81d2414c32d491f1bf994263c74;hp=2b1e5d7561c0aa3856d0b0a499bc799a9fa73af2;hpb=75d621fb12f4d3bc3e2eecefac39fe62eecbd431;p=chise%2Fxemacs-chise.git diff --git a/lib-src/gnuclient.c b/lib-src/gnuclient.c index 2b1e5d7..4ed986d 100644 --- a/lib-src/gnuclient.c +++ b/lib-src/gnuclient.c @@ -48,6 +48,10 @@ Boston, MA 02111-1307, USA. * ../etc/gnuserv.README relative to the directory containing this file) */ +#ifdef CYGWIN +extern void cygwin_conv_to_posix_path(const char *path, char *posix_path); +#endif + #include "gnuserv.h" char gnuserv_version[] = "gnuclient version " GNUSERV_VERSION; @@ -189,35 +193,26 @@ filename_expand (char *fullpath, char *filename) /* fullpath - returned full pathname */ /* filename - filename to expand */ { - int len; +#ifdef CYGWIN + char cygwinFilename[MAXPATHLEN+1]; +#endif + int len; fullpath[0] = '\0'; +#ifdef CYGWIN + /* + If we're in cygwin, just convert it and let the unix stuff handle it. + */ + cygwin_conv_to_posix_path(filename, cygwinFilename); + filename = cygwinFilename; +#endif + if (filename[0] && filename[0] == '/') { /* Absolute (unix-style) pathname. Do nothing */ strcat (fullpath, filename); } -#ifdef CYGWIN - else if (filename[0] && filename[0] == '\\' && - filename[1] && filename[1] == '\\') - { - /* This path includes the server name (something like - "\\server\path"), so we assume it's absolute. Do nothing to - it. */ - strcat (fullpath, filename); - } - else if (filename[0] && - filename[1] && filename[1] == ':' && - filename[2] && filename[2] == '\\') - { - /* Absolute pathname with drive letter. Convert ":" - to "///". */ - strcat (fullpath, "//"); - strncat (fullpath, filename, 1); - strcat (fullpath, &filename[2]); - } -#endif else { /* Assume relative Unix style path. Get the current directory