diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-09-03 18:36:55 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-09-03 18:36:55 +0000 |
commit | 73953b786bf1e8a0fca5b079a66cca5cf47371ff (patch) | |
tree | 3974ab298363324f25b3f7fd6cd73661eb49f982 /lib-src | |
parent | c796c96aab9b6d917186e66a3e829b5e075b292e (diff) | |
download | emacs-73953b786bf1e8a0fca5b079a66cca5cf47371ff.tar.gz |
(etags_getcwd): Use getcwd if available even if MSDOS.
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/etags.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index 35e396c3be7..536ca567f18 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -4332,19 +4332,7 @@ concat (s1, s2, s3) char * etags_getcwd () { -#ifdef MSDOS - char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ - - getwd (path); - for (p = path; *p != '\0'; p++) - if (*p == '\\') - *p = '/'; - else - *p = lowcase (*p); - - return strdup (path); -#else /* not MSDOS */ -#if HAVE_GETCWD +#ifdef HAVE_GETCWD int bufsize = 200; char *path = xnew (bufsize, char); @@ -4357,7 +4345,20 @@ etags_getcwd () } return path; -#else /* not MSDOS and not HAVE_GETCWD */ +#else /* not HAVE_GETCWD */ +#ifdef MSDOS + char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ + + getwd (path); + + for (p = path; *p != '\0'; p++) + if (*p == '\\') + *p = '/'; + else + *p = lowcase (*p); + + return strdup (path); +#else /* not MSDOS */ struct linebuffer path; FILE *pipe; @@ -4368,8 +4369,8 @@ etags_getcwd () pclose (pipe); return path.buffer; -#endif /* not HAVE_GETCWD */ #endif /* not MSDOS */ +#endif /* not HAVE_GETCWD */ } /* Return a newly allocated string containing the filename |