aboutsummaryrefslogtreecommitdiff
path: root/sfmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'sfmain.c')
-rw-r--r--sfmain.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/sfmain.c b/sfmain.c
index 9432508..3cbd336 100644
--- a/sfmain.c
+++ b/sfmain.c
@@ -452,7 +452,7 @@ error:
}
-static int configure_driver(LPTSRDATA data)
+static int configure_driver(LPTSRDATA data, bool short_fnames)
{
unsigned i;
int32_t err;
@@ -481,6 +481,16 @@ static int configure_driver(LPTSRDATA data)
data->tz_offset = 0;
}
+ // Get uppercase and valid file char tables
+ err = get_nls(&data->file_upper_case, &data->file_char);
+ if (err) {
+ puts("Cannot get the NLS tables.");
+ return -1;
+ }
+
+ // Set use of short file names from Windows hosts
+ data->short_fnames = short_fnames;
+
// Now try to initialize VirtualBox communication
err = vbox_init_device(&data->vb);
if (err) {
@@ -512,12 +522,6 @@ static int configure_driver(LPTSRDATA data)
return -1;
}
- err = get_nls(&data->file_upper_case, &data->file_char);
- if (err) {
- puts("Cannot get the NLS tables.");
- return -1;
- }
-
load_unicode_table( &data->unicode_table);
printf("Connected to VirtualBox shared folder service\n");
@@ -617,6 +621,7 @@ static void print_help(void)
"Supported actions:\n"
" install install the driver (default)\n"
" low install in conventional memory (otherwise UMB)\n"
+ " short use short file names from windows hosts\n"
" uninstall uninstall the driver from memory\n"
" list list available shared folders\n"
" mount <FOLD> <X:> mount a shared folder into drive X:\n"
@@ -668,6 +673,7 @@ int main(int argc, const char *argv[])
if (argi >= argc || stricmp(argv[argi], "install") == 0) {
bool high = true;
+ bool short_fnames = false;
argi++;
for (; argi < argc; argi++) {
@@ -675,6 +681,8 @@ int main(int argc, const char *argv[])
high = false;
} else if (stricmp(argv[argi], "high") == 0) {
high = true;
+ } else if (stricmp(argv[argi], "short") == 0) {
+ short_fnames = true;
} else {
return invalid_arg(argv[argi]);
}
@@ -695,7 +703,7 @@ int main(int argc, const char *argv[])
} else {
deallocate_environment(_psp);
}
- err = configure_driver(data);
+ err = configure_driver(data, short_fnames);
if (err) {
if (high) cancel_reallocation(FP_SEG(data));
return EXIT_FAILURE;