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.
#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 */
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
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