changeset 16086:33519c691e63

(etags_getcwd): Use getcwd if available even if MSDOS.
author Richard M. Stallman <rms@gnu.org>
date Tue, 03 Sep 1996 18:36:55 +0000
parents b215fb935fc3
children 26b552f014ff
files lib-src/etags.c
diffstat 1 files changed, 16 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/etags.c	Tue Sep 03 18:16:06 1996 +0000
+++ b/lib-src/etags.c	Tue Sep 03 18:36:55 1996 +0000
@@ -4332,19 +4332,7 @@
 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 @@
     }
 
   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 @@
   pclose (pipe);
 
   return path.buffer;
+#endif /* not MSDOS */
 #endif /* not HAVE_GETCWD */
-#endif /* not MSDOS */
 }
 
 /* Return a newly allocated string containing the filename