aboutsummaryrefslogtreecommitdiff
path: root/sfmain.c
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2026-11-29 18:53:52 +0100
committerJavier <dev.git@javispedro.com>2026-11-29 18:53:52 +0100
commit5898f13480921e1c1ab362852f88794ea955ffce (patch)
treefec95835799d78708c49ea144e1955a7d22f9ede /sfmain.c
parent8e9df5624d56a91eaa71a1ceac4932b7c5c5ee48 (diff)
downloadvbados-5898f13480921e1c1ab362852f88794ea955ffce.tar.gz
vbados-5898f13480921e1c1ab362852f88794ea955ffce.zip
vbsf: add ability to build without hashing of long filenames
Diffstat (limited to 'sfmain.c')
-rw-r--r--sfmain.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sfmain.c b/sfmain.c
index 4f102bb..0c3038d 100644
--- a/sfmain.c
+++ b/sfmain.c
@@ -204,7 +204,7 @@ static int unmount_shfl(LPTSRDATA data, int drive)
static void set_mountopts_defaults(MOUNTOPTS *opts)
{
- opts->generate_sfn = true;
+ opts->generate_sfn = USE_LFN_TO_SHORT;
opts->require_uppercase = false;
opts->use_host_sfn = false;
opts->hash_chars = DEF_HASH_CHARS;
@@ -726,10 +726,12 @@ static void print_help(void)
puts( _(0, 5, " uninstall Uninstall the driver from memory."));
puts( _(0, 6, " list List available shared folders."));
puts( _(0, 7, " mount <FOLD> <X:> ... Mount a shared folder into drive X:."));
+#if USE_LFN_TO_SHORT
puts( _(0, 8, " /hash <n> Number of hash chars following the '~'"));
puts( _(0, 9, " for generated DOS short filenames."));
printf(_(0, 10, " (between %d and %d; default %d; 0 to disable)\n"),
MIN_HASH_CHARS, MAX_HASH_CHARS, DEF_HASH_CHARS);
+#endif
puts( _(0, 11, " /host Use short file names from Windows hosts."));
puts( _(0, 12, " /upper Require uppercase host filenames."));
puts( _(0, 13, " remount <X:> ... Change mount options for mounted drive X:."));
@@ -778,6 +780,7 @@ static int parse_mountopts(MOUNTOPTS *opts, int *argi, int argc, const char *arg
int i = *argi;
while (argv[i][0] == '/' && i < argc) {
if (stricmp(argv[i], "/hash") == 0) {
+#if USE_LFN_TO_SHORT
i++;
if (i >= argc) return arg_required("/hash");
@@ -793,6 +796,9 @@ static int parse_mountopts(MOUNTOPTS *opts, int *argi, int argc, const char *arg
} else {
return invalid_arg(argv[i]);
}
+#else
+ return invalid_arg(argv[i]);
+#endif
} else if (stricmp(argv[i], "/nohash") == 0) {
opts->generate_sfn = false;
} else if (stricmp(argv[i], "/host") == 0) {