]> git.eshelyaron.com Git - emacs.git/commitdiff
[MSDOS]: #include <sys/param.h> for the following.
authorRichard M. Stallman <rms@gnu.org>
Sat, 30 Apr 1994 19:34:26 +0000 (19:34 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 30 Apr 1994 19:34:26 +0000 (19:34 +0000)
[MSDOS] (etags_getcwd): Define simple MSDOS version without spawning a shell.

lib-src/etags.c

index 9bd4bce83f5185efd111d3d20f36e341538d695a..bae7e17207acef611aabf88554eb56f5746f2cc7 100644 (file)
@@ -32,6 +32,7 @@ char pot_etags_version[] = "@(#) pot revision number is 10.32";
 
 #ifdef MSDOS
 #include <fcntl.h>
+#include <sys/param.h>
 #endif /* MSDOS */
 
 #ifdef HAVE_CONFIG_H
@@ -3123,6 +3124,21 @@ concat (s1, s2, s3)
   return result;
 }
 \f
+#ifdef MSDOS
+char *
+etags_getcwd ()
+{
+  char *p, cwd[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS.  */
+  getwd (cwd);
+  p = cwd;
+  while (*p)
+    if (*p == '\\')
+      *p++ = '/';
+    else
+      *p++ = tolower (*p);
+  return strdup (cwd);
+}
+#else /* not MSDOS */
 /* Does the same work as the system V getcwd, but does not need to
    guess buffer size in advance.  Included mostly for compatibility. */
 char *
@@ -3155,6 +3171,7 @@ etags_getcwd ()
 
   return buf;
 }
+#endif /* not MSDOS */
 
 /* Return a newly allocated string containing the filename
    of FILE relative to the absolute directory DIR (which