X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fhtparser.c;h=e281abd85701d9b11bea7e9aa7bd9323b6b0d2ff;hb=7d1e14f405f389656604c68e18a381feabcd3d4a;hp=348a9407f3a9733ff66e3ded9e34248dd5d9c1d4;hpb=5599a52ae7067a2c2afd0fda9edd3046043847c1;p=ashd.git diff --git a/src/htparser.c b/src/htparser.c index 348a940..e281abd 100644 --- a/src/htparser.c +++ b/src/htparser.c @@ -607,7 +607,7 @@ int main(int argc, char **argv) struct passwd *pwent; daemonize = usesyslog = 0; - root = NULL; + root = pidfile = NULL; pwent = NULL; while((c = getopt(argc, argv, "+hSfu:r:p:")) >= 0) { switch(c) { @@ -621,16 +621,16 @@ int main(int argc, char **argv) usesyslog = 1; break; case 'u': - if((pwent = getpwnam(optarg)) == NULL) { + if(optarg[0] && ((pwent = getpwnam(optarg)) == NULL)) { flog(LOG_ERR, "could not find user %s", optarg); exit(1); } break; case 'r': - root = optarg; + root = optarg[0] ? optarg : NULL; break; case 'p': - pidfile = optarg; + pidfile = optarg[0] ? optarg : NULL; break; default: usage(stderr);