Fixed canonicalizing the file name in the SVDRP command GRAB to allow full path names

This commit is contained in:
Klaus Schmidinger 2006-01-14 11:45:43 +01:00
parent 7962576727
commit 8763908621
3 changed files with 12 additions and 5 deletions

View File

@ -211,6 +211,8 @@ Stefan Huelswitt <huels@iname.com>
live PIDs live PIDs
for reporting a problem in SetProgress() of the 'skincurses' plugin in case Total for reporting a problem in SetProgress() of the 'skincurses' plugin in case Total
is 0 is 0
for fixing canonicalizing the file name in the SVDRP command GRAB to allow full
path names
Ulrich Röder <roeder@efr-net.de> Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than 27500 for pointing out that there are channels that have a symbol rate higher than 27500

View File

@ -4166,3 +4166,5 @@ Video Disk Recorder Revision History
- Removed the now obsolete "ca.conf" section from vdr.1 (thanks to Ville Skyttä). - Removed the now obsolete "ca.conf" section from vdr.1 (thanks to Ville Skyttä).
- Added missing description of L and R circular polarization to 'diseqc.conf'. - Added missing description of L and R circular polarization to 'diseqc.conf'.
- Added a note about "modprobe capability" to INSTALL (suggested by Patrick Cernko). - Added a note about "modprobe capability" to INSTALL (suggested by Patrick Cernko).
- Fixed canonicalizing the file name in the SVDRP command GRAB to allow full path
names (thanks to Stefan Huelswitt).

13
svdrp.c
View File

@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured * and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection. * graphical interface that sits on top of an SVDRP connection.
* *
* $Id: svdrp.c 1.90 2006/01/08 13:31:00 kls Exp $ * $Id: svdrp.c 1.91 2006/01/14 11:42:52 kls Exp $
*/ */
#include "svdrp.h" #include "svdrp.h"
@ -731,10 +731,13 @@ void cSVDRP::CmdGRAB(const char *Option)
char RealFileName[PATH_MAX]; char RealFileName[PATH_MAX];
if (FileName) { if (FileName) {
if (grabImageDir) { if (grabImageDir) {
char *s; char *s = 0;
asprintf(&s, "%s/%s", grabImageDir, FileName); char *slash = strrchr(FileName, '/');
FileName = s; if (!slash) {
char *slash = strrchr(FileName, '/'); // there definitely is one asprintf(&s, "%s/%s", grabImageDir, FileName);
FileName = s;
}
slash = strrchr(FileName, '/'); // there definitely is one
*slash = 0; *slash = 0;
char *r = realpath(FileName, RealFileName); char *r = realpath(FileName, RealFileName);
*slash = '/'; *slash = '/';