summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-01-14 11:45:43 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2006-01-14 11:45:43 +0100
commit8763908621964a6219d3129f9995828882ea4c6a (patch)
tree0f89db0a1f5321ff033df3438558c40f6a2dd1c3
parent79625767279c256949c8305f66154f1a4fcd0ffa (diff)
downloadvdr-8763908621964a6219d3129f9995828882ea4c6a.tar.gz
vdr-8763908621964a6219d3129f9995828882ea4c6a.tar.bz2
Fixed canonicalizing the file name in the SVDRP command GRAB to allow full path names
-rw-r--r--CONTRIBUTORS2
-rw-r--r--HISTORY2
-rw-r--r--svdrp.c13
3 files changed, 12 insertions, 5 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index e2dd4980..659ece05 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -211,6 +211,8 @@ Stefan Huelswitt <huels@iname.com>
live PIDs
for reporting a problem in SetProgress() of the 'skincurses' plugin in case Total
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>
for pointing out that there are channels that have a symbol rate higher than 27500
diff --git a/HISTORY b/HISTORY
index 7dc2d43d..55cbb232 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4166,3 +4166,5 @@ Video Disk Recorder Revision History
- 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 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).
diff --git a/svdrp.c b/svdrp.c
index db07a1fd..01e156d2 100644
--- a/svdrp.c
+++ b/svdrp.c
@@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured
* 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"
@@ -731,10 +731,13 @@ void cSVDRP::CmdGRAB(const char *Option)
char RealFileName[PATH_MAX];
if (FileName) {
if (grabImageDir) {
- char *s;
- asprintf(&s, "%s/%s", grabImageDir, FileName);
- FileName = s;
- char *slash = strrchr(FileName, '/'); // there definitely is one
+ char *s = 0;
+ char *slash = strrchr(FileName, '/');
+ if (!slash) {
+ asprintf(&s, "%s/%s", grabImageDir, FileName);
+ FileName = s;
+ }
+ slash = strrchr(FileName, '/'); // there definitely is one
*slash = 0;
char *r = realpath(FileName, RealFileName);
*slash = '/';