}
/* Get the default directory for a given drive. 0=def, 1=A, 2=B, ... */
+void msdos_downcase_filename (unsigned char *);
int
getdefdir (drive, dst)
if (errno)
return 0;
- /* Under LFN we expect to get pathnames in their true case. */
- if (! (_USE_LFN))
- for (p = dst; *p; p++)
- if (*p >= 'A' && *p <= 'Z')
- *p += 'a' - 'A';
+ msdos_downcase_filename (dst);
errno = e;
return 1;
{
return (_USE_LFN ? Qt : Qnil);
}
+
+/* Convert alphabetic characters in a filename to lower-case. */
+
+void
+msdos_downcase_filename (p)
+ register unsigned char *p;
+{
+ /* Under LFN we expect to get pathnames in their true case. */
+ if (NILP (Fmsdos_long_file_names ()))
+ for ( ; *p; p++)
+ if (*p >= 'A' && *p <= 'Z')
+ *p += 'a' - 'A';
+}
+
+DEFUN ("msdos-downcase-filename", Fmsdos_downcase_filename, Smsdos_downcase_filename,
+ 1, 1, 0,
+ "Convert alphabetic characters in FILENAME to lower case and return that.\n\
+When long filenames are supported, doesn't change FILENAME.")
+ (filename)
+ Lisp_Object filename;
+{
+ char *fname = XSTRING (filename)->data;
+
+ msdos_downcase_filename (fname);
+ return make_string (fname, XSTRING (filename)->size);
+}
\f
/* The Emacs root directory as determined by init_environment. */
defsubr (&Srecent_doskeys);
defsubr (&Smsdos_long_file_names);
+ defsubr (&Smsdos_downcase_filename);
}
#endif /* MSDOS */