From: Andre Noll Date: Sun, 31 Jan 2010 22:16:15 +0000 (+0100) Subject: recv: Don't set argv to NULL when parsing receiver args. X-Git-Tag: v0.4.2~63^2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=70f527312e613fd89be88177dc2a44ad24b2d27c;p=paraslash.git recv: Don't set argv to NULL when parsing receiver args. This leads to error messages like (null): unrecognized option '--foo' in case an invalid option was given. Fix it by setting argv[0] to the receiver name instead. Thanks to Gerrit Renker for pointing out this bug. --- diff --git a/recv_common.c b/recv_common.c index 953e2a11..00c1dd84 100644 --- a/recv_common.c +++ b/recv_common.c @@ -42,15 +42,13 @@ static void *parse_receiver_args(int receiver_num, char *options) argc = split_args(options, &argv, " \t"); for (i = argc - 1; i >= 0; i--) argv[i + 1] = argv[i]; - argv[0] = para_strdup(r->name); argc += 1; - PARA_DEBUG_LOG("argc = %d, argv[0]: %s\n", argc, argv[0]); } else { argc = 1; argv = para_malloc(2 * sizeof(char*)); - argv[0] = NULL; argv[1] = NULL; } + argv[0] = make_message("%s_recv", r->name); conf = r->parse_config(argc, argv); free(argv[0]); free(argv);