Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: shutting down vdr



Arno Esser wrote:
> 
> Hello,
> 
> recently I had a problem to shut down my vdr by pressing the power
> button. vdr always complains about EOF while scanning command string.
> After some time I found the problem. I had a timer active with a ' in
> its name. Since the name is passed over to the shutdown command the
> execl call was unable to scan the command correctly. The log file says
> something like:
> 
>  executing '/dvb/haltvdr 1011974880 1364715 20 'Käpt'n Blaubär' 1'
> 
> After deleting the timer entry everything works fine.
> 
> Ciao Arno

Here's a quick&dirty hack to work around this. I'll come up with a
better solution later:

--- vdr.c       Sat Nov  3 13:23:45 2001
+++ vdr.c       Wed Jan  9 22:58:46 2002
@@ -506,9 +506,10 @@
                     bool UserShutdown = key == kPower;
                     if (Interface->Confirm(tr("Press any key to cancel shutdown"), UserShutdown ? 5 : SHUTDOWNWAIT, true)) {
                        int Channel = timer ? timer->channel : 0;
-                       const char *File = timer ? timer->file : "";
+                       const char *File = strreplace(strdup(timer ? timer->file : ""), '\'', ' ');
                        char *cmd;
                        asprintf(&cmd, "%s %ld %ld %d '%s' %d", Shutdown, Next, Delta, Channel, File, UserShutdown);
+                       delete File;
                        isyslog(LOG_INFO, "executing '%s'", cmd);
                        SystemExec(cmd);
                        delete cmd;

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________



Home | Main Index | Thread Index