X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=server-src%2Fcmdline.c;fp=server-src%2Fcmdline.c;h=c7894216510aef949bca425d2fa5ca9518a2099d;hb=d28952249e392eb31bc8eecc53f6c477f30c617b;hp=600d50060477ff221816c2e4618aac15f5db0b0e;hpb=949b8910a5e23c4285d0b1aedacfc82a14dc97a5;p=debian%2Famanda diff --git a/server-src/cmdline.c b/server-src/cmdline.c index 600d500..c789421 100644 --- a/server-src/cmdline.c +++ b/server-src/cmdline.c @@ -1,9 +1,10 @@ /* * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY @@ -89,7 +90,12 @@ cmdline_parse_dumpspecs( enum { ARG_GET_HOST, ARG_GET_DISK, ARG_GET_DATESTAMP, ARG_GET_LEVEL } arg_state = ARG_GET_HOST; while (optind < argc) { + char *new_name = NULL; name = argv[optind]; + if (flags & CMDLINE_EXACT_MATCH && *name != '=') { + new_name = g_strconcat("=", name, NULL); + name = new_name; + } switch (arg_state) { case ARG_GET_HOST: arg_state = ARG_GET_DISK; @@ -112,12 +118,14 @@ cmdline_parse_dumpspecs( arg_state = ARG_GET_HOST; if (!(flags & CMDLINE_PARSE_LEVEL)) continue; if (name[0] != '\0' + && !(flags & CMDLINE_EXACT_MATCH) && (errstr=validate_regexp(name)) != NULL) { error(_("bad level regex \"%s\": %s\n"), name, errstr); } dumpspec->level = stralloc(name); break; } + amfree(new_name); optind++; }