Commit bf794306 authored by Eli Zaretskii's avatar Eli Zaretskii

(emacs_root_dir): New function.

parent dd693537
2001-12-19 Eli Zaretskii <eliz@is.elta.co.il>
* w32.c (emacs_root_dir): New function.
* msdos.c (emacs_root_dir): New function.
* fileio.c (Fexpand_file_name) [DOS_NT]: Use the root directory
of the current drive as the fallback for default_directory.
* dired.c (file_name_completion): Run the elements of
completion-ignored-extensions through ENCODE_FILE.
......
......@@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */
#include <string.h> /* for bzero and string functions */
#include <sys/stat.h> /* for _fixpath */
#include <unistd.h> /* for chdir, dup, dup2, etc. */
#include <dir.h> /* for getdisk */
#if __DJGPP__ >= 2
#include <fcntl.h>
#include <io.h> /* for setmode */
......@@ -4118,6 +4119,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
......
......@@ -875,6 +875,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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment