diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2013-03-12 13:27:40 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2013-03-12 13:27:40 +0100 |
commit | ec7fac3c0d5b8b9a9e95072bfb15a9e97fb5567b (patch) | |
tree | 05aadf099853ab486204ac0ae333cb4b23a6f89f /vdr.c | |
parent | cee221e8432bd126577c3c142862b99686ddc349 (diff) | |
download | vdr-ec7fac3c0d5b8b9a9e95072bfb15a9e97fb5567b.tar.gz vdr-ec7fac3c0d5b8b9a9e95072bfb15a9e97fb5567b.tar.bz2 |
Some improvements to allowing the parameters PATH and NAME to the --dirnames command line option to be left empty to use the default values if only ENC shall be set
Diffstat (limited to 'vdr.c')
-rw-r--r-- | vdr.c | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -22,7 +22,7 @@ * * The project's page is at http://www.tvdr.de * - * $Id: vdr.c 2.54 2013/03/12 09:23:33 kls Exp $ + * $Id: vdr.c 2.55 2013/03/12 13:27:40 kls Exp $ */ #include <getopt.h> @@ -287,13 +287,16 @@ int main(int argc, char *argv[]) return 2; } DirectoryPathMax = n; + if (!*s) + break; + if (*s != ',') { + fprintf(stderr, "vdr: invalid delimiter: %s\n", optarg); + return 2; + } } + s++; if (!*s) break; - if (*s++ != ',') { - fprintf(stderr, "vdr: invalid delimiter: %s\n", optarg); - return 2; - } if (*s != ',') { int n = strtol(s, &s, 10); if (n <= 0 || n > NAME_MAX) { // NAME_MAX excludes the terminating 0 @@ -301,13 +304,16 @@ int main(int argc, char *argv[]) return 2; } DirectoryNameMax = n; + if (!*s) + break; + if (*s != ',') { + fprintf(stderr, "vdr: invalid delimiter: %s\n", optarg); + return 2; + } } + s++; if (!*s) break; - if (*s++ != ',') { - fprintf(stderr, "vdr: invalid delimiter: %s\n", optarg); - return 2; - } int n = strtol(s, &s, 10); if (n != 0 && n != 1) { fprintf(stderr, "vdr: invalid directory encoding: %s\n", optarg); |