summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-03-12 13:27:40 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2013-03-12 13:27:40 +0100
commitec7fac3c0d5b8b9a9e95072bfb15a9e97fb5567b (patch)
tree05aadf099853ab486204ac0ae333cb4b23a6f89f
parentcee221e8432bd126577c3c142862b99686ddc349 (diff)
downloadvdr-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
-rw-r--r--CONTRIBUTORS2
-rw-r--r--HISTORY3
-rw-r--r--vdr.c24
3 files changed, 19 insertions, 10 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 8490ca33..d56459d8 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -616,6 +616,8 @@ Helmut Auer <vdr@helmutauer.de>
--genindex
for suggesting to disable EPG processing for a while after a CLRE command
for suggesting to read the epg.data file in a separate thread
+ for 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
Jeremy Hall <jhall@UU.NET>
for fixing an incomplete initialization of the filter parameters in eit.c
diff --git a/HISTORY b/HISTORY
index c1cd4d67..2f955ec4 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7741,7 +7741,8 @@ Video Disk Recorder Revision History
"lib$$i-*.so" (previously only "libvdr-*.so") and also descends into subdirectories
of the plugin source.
- The parameters PATH and NAME to the --dirnames command line option may now be left
- empty to use the default values if only ENC shall be set.
+ empty to use the default values if only ENC shall be set (thanks to Helmut Auer for
+ some improvements to this change).
- Fixed a possible "Channel not available" if a recording starts on a system with
bonded devices (thanks to Siegfried Bosch).
- Fixed stopping an ongoing recording on a system with bonded devices, if a timer with
diff --git a/vdr.c b/vdr.c
index 432712ba..742d1699 100644
--- a/vdr.c
+++ b/vdr.c
@@ -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);