diff options
Diffstat (limited to 'pkgrel.c')
-rw-r--r-- | pkgrel.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -118,13 +118,14 @@ parse_args(const int argc, char* argv[]) { int opt; const char* prefix = NULL; - while (-1 != (opt = getopt(argc, argv, ":d"))) { + while (NULL == prefix && -1 != (opt = getopt(argc, argv, ":d"))) { switch (opt) { case 'd': prefix = "pkgrel="; break; default: - break; // Accept anything but -d without prior -- + prefix = argv[optind - 1]; // Use first option that is not -d as a normal prefix, too. + break; } } if (NULL == prefix) { |