diff options
-rw-r--r-- | vncviewer/vncviewer.cxx | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index 67013027..53ff4b0c 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -493,27 +493,32 @@ int main(int argc, char** argv) if (alertOnFatalError) fl_alert("%s", e.str()); } - - int i = 1; - if (!Fl::args(argc, argv, i) || i < argc) - for (; i < argc; i++) { - if (Configuration::setParam(argv[i])) - continue; - - if (argv[i][0] == '-') { - if (i+1 < argc) { - if (Configuration::setParam(&argv[i][1], argv[i+1])) { - i++; - continue; - } + + for (int i = 1; i < argc;) { + if (Fl::arg(argc, argv, i)) + continue; + + if (Configuration::setParam(argv[i])) { + i++; + continue; + } + + if (argv[i][0] == '-') { + if (i+1 < argc) { + if (Configuration::setParam(&argv[i][1], argv[i+1])) { + i += 2; + continue; } - usage(argv[0]); } - strncpy(vncServerName, argv[i], VNCSERVERNAMELEN); - vncServerName[VNCSERVERNAMELEN - 1] = '\0'; + usage(argv[0]); } + strncpy(vncServerName, argv[i], VNCSERVERNAMELEN); + vncServerName[VNCSERVERNAMELEN - 1] = '\0'; + i++; + } + mkvnchomedir(); #if !defined(WIN32) && !defined(__APPLE__) |