From 95e1c1146758282807e84d1125fe82e12fe2ce26 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 29 Jul 2002 01:26:59 +0000 Subject: [PATCH] (emacs_root_dir): New function. --- src/msdos.c | 10 ++++++++++ src/w32.c | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/msdos.c b/src/msdos.c index a3aadd9a603..967796f5e1a 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -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 diff --git a/src/w32.c b/src/w32.c index f5ea84a6111..b149183c06f 100644 --- 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 -- 2.39.5