Closed stsp closed 1 year ago
LFN is disabled by default. _CRT0_FLAG_NO_LFN is set in _crt0_startup_flags
.
To enable LFN, comment out _CRT0_FLAG_NO_LFN and disable the uppercase conversion in extract_token
diff --git a/command.c b/command.c
index aeea717..42a1651 100644
--- a/command.c
+++ b/command.c
@@ -116,7 +116,7 @@ extern char **environ;
int _crt0_startup_flags =
_CRT0_FLAG_USE_DOS_SLASHES | // keep the backslashes
_CRT0_FLAG_DISALLOW_RESPONSE_FILES | // no response files (i.e. `@gcc.rf')
- _CRT0_FLAG_NO_LFN | // disable long file names
+ //_CRT0_FLAG_NO_LFN | // disable long file names
_CRT0_FLAG_LOCK_MEMORY | // disable virtual memory
_CRT0_FLAG_PRESERVE_FILENAME_CASE; // keep DOS names uppercase
char **__crt0_glob_function(char *_argument UNUSED) {return NULL;} // prevent wildcard expansion of arguments of main()
@@ -2563,6 +2563,11 @@ again:
advance_iter(iter);
return tok;
}
+
+#ifdef __DJGPP__
+ /* only when using NO_LFN should we uppercase the wildcard token */
+ if ((_crt0_startup_flags & _CRT0_FLAG_NO_LFN))
+#endif
strupr(iter->token);
if (glob(iter->token, 0, NULL, &iter->gl))
{
That's interesting. @andrewbird would you like to test that change to make sure it actually passes the LFN tests?
Sorry I have no time today, but I don't think any of the tests use LFNs in the shell itself anyway.
Indeed with a minimal testing it appears to work. DIR displays LFNs, COPY copies them properly, no obvious buffer overflows... What else is to desire? :)
Commands like
dir
,copy
etc may use lfns.