]> git.eshelyaron.com Git - emacs.git/commitdiff
(emacs_root_dir): New function.
authorRichard M. Stallman <rms@gnu.org>
Mon, 29 Jul 2002 01:26:59 +0000 (01:26 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 29 Jul 2002 01:26:59 +0000 (01:26 +0000)
src/msdos.c
src/w32.c

index a3aadd9a603d061f1924179b0a7b3b374805771c..967796f5e1adc992080e7f719e9d465b73595d4e 100644 (file)
@@ -4142,6 +4142,16 @@ getdefdir (drive, dst)
   return 1;
 }
 
+char *
+emacs_root_dir (void)
+{
+  static char root_dir[4];
+
+  sprintf (root_dir, "%c:/", 'A' + getdisk ());
+  root_dir[0] = tolower (root_dir[0]);
+  return root_dir;
+}
+
 /* Remove all CR's that are followed by a LF.  */
 
 int
index f5ea84a6111a0339fc487f2a4d9b17416610b495..b149183c06f3dcbdec198c5a6b20de639e1fa1c9 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -880,6 +880,21 @@ init_environment (char ** argv)
   init_user_info ();
 }
 
+char *
+emacs_root_dir (void)
+{
+  static char root_dir[FILENAME_MAX];
+  const char *p;
+
+  p = getenv ("emacs_dir");
+  if (p == NULL)
+    abort ();
+  strcpy (root_dir, p);
+  root_dir[parse_root (root_dir, NULL)] = '\0';
+  dostounix_filename (root_dir);
+  return root_dir;
+}
+
 /* We don't have scripts to automatically determine the system configuration
    for Emacs before it's compiled, and we don't want to have to make the
    user enter it, so we define EMACS_CONFIGURATION to invoke this runtime