Fixed handling of video directory names with training slashes

This commit is contained in:
Klaus Schmidinger 2000-09-17 14:18:14 +02:00
parent 925780c20f
commit d79dc06f6c
3 changed files with 9 additions and 2 deletions

View File

@ -190,3 +190,6 @@ Video Disk Recorder Revision History
- The new SVDRP commands 'OVL*' can be used to control video overlays (thanks - The new SVDRP commands 'OVL*' can be used to control video overlays (thanks
to Guido Fiala!). This is mainly for use in the 'kvdr' tool (see the 'kvdr' to Guido Fiala!). This is mainly for use in the 'kvdr' tool (see the 'kvdr'
page at http://www.s.netic.de/gfiala). page at http://www.s.netic.de/gfiala).
- If the name of the video directory used with the '-v' option had trailing
slashes, the recording file names have been damaged. Trailing slashes are
now silently removed.

View File

@ -64,7 +64,9 @@ All recordings are written into directories below "/video". Please
make sure this directory exists, and that the user who runs the 'vdr' make sure this directory exists, and that the user who runs the 'vdr'
program has read and write access to that directory. program has read and write access to that directory.
If you prefer a different location for your video files, you can use If you prefer a different location for your video files, you can use
the '-v' option to change that. the '-v' option to change that. Please make sure that the directory
name you use with '-v' is a clean and absolute path name (no '..' or
multiple slashes).
Note that the file system need not be 64-bit proof, since the 'vdr' Note that the file system need not be 64-bit proof, since the 'vdr'
program splits video files into chunks of about 1GB. You should use program splits video files into chunks of about 1GB. You should use

4
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * The project's page is at http://www.cadsoft.de/people/kls/vdr
* *
* $Id: vdr.c 1.32 2000/09/15 15:01:08 kls Exp $ * $Id: vdr.c 1.33 2000/09/17 14:15:24 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -116,6 +116,8 @@ int main(int argc, char *argv[])
} }
break; break;
case 'v': VideoDirectory = optarg; case 'v': VideoDirectory = optarg;
while (optarg && *optarg && optarg[strlen(optarg) - 1] == '/')
optarg[strlen(optarg) - 1] = 0;
break; break;
default: abort(); default: abort();
} }