# HG changeset patch # User Eli Zaretskii # Date 1008788204 0 # Node ID bd23b0c564d9b8b67e762e8632094593c4be6c76 # Parent 12131c06473a8f2107cec18bb0174bfecfd0ba86 (emacs_root_dir): New function. diff -r 12131c06473a -r bd23b0c564d9 src/msdos.c --- a/src/msdos.c Wed Dec 19 18:55:01 2001 +0000 +++ b/src/msdos.c Wed Dec 19 18:56:44 2001 +0000 @@ -38,6 +38,7 @@ #include /* for bzero and string functions */ #include /* for _fixpath */ #include /* for chdir, dup, dup2, etc. */ +#include /* for getdisk */ #if __DJGPP__ >= 2 #include #include /* for setmode */ @@ -4118,6 +4119,16 @@ 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 -r 12131c06473a -r bd23b0c564d9 src/w32.c --- a/src/w32.c Wed Dec 19 18:55:01 2001 +0000 +++ b/src/w32.c Wed Dec 19 18:56:44 2001 +0000 @@ -875,6 +875,21 @@ 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