diff options
-rw-r--r-- | src/or/main.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/or/main.c b/src/or/main.c index c5d9406b0..e0427b8cf 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1672,13 +1672,15 @@ tor_main(int argc, char *argv[]) #ifdef MS_WINDOWS_SERVICE backup_argv = argv; backup_argc = argc; - if ((argc >= 2) && !strcmp(argv[1], "-install")) - return nt_service_install(); - if ((argc >= 2) && !strcmp(argv[1], "-remove")) - return nt_service_remove(); - if ((argc >= 2) && !strcmp(argv[1], "--nt-service")) { - nt_service_main(); - return 0; + if (argc >= 2) { + if (!strcmp(argv[1], "-install") || !strcmp(argv[1], "--install")) + return nt_service_install(); + if (!strcmp(argv[1], "-remove") || !strcmp(argv[1], "--remove")) + return nt_service_remove(); + if (!strcmp(argv[1], "-nt-service") || !strcmp(argv[1], "--nt-service")) { + nt_service_main(); + return 0; + } } #endif if (tor_init(argc, argv)<0) |