summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-03-02 23:00:53 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2001-03-02 23:00:53 +0100
commite3c265d186b9fe73b7d1f215d79dde4a4f52709c (patch)
treeac73aa27aad33439d42459ebb196df716f9eabb9
parent76521306b1c8bc2c357bdb7cecc7dd6c276138e5 (diff)
downloadvdr-e3c265d186b9fe73b7d1f215d79dde4a4f52709c.tar.gz
vdr-e3c265d186b9fe73b7d1f215d79dde4a4f52709c.tar.bz2
SVDRP commands LSTC and LSTT now return an error message if no channels or timers are defined
-rw-r--r--HISTORY6
-rw-r--r--svdrp.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 684d2b65..9dee40dc 100644
--- a/HISTORY
+++ b/HISTORY
@@ -413,3 +413,9 @@ Video Disk Recorder Revision History
VDR exit in case the main program loop does not respond for more than the
given number of seconds. This is mainly useful in combination with the new
'runvdr' script that restarts VDR in case is has exited.
+
+2001-03-02: Version 0.72
+
+- Fixed SVDRP commands LSTC and LSTT to make them return an error message if
+ no channels or timers are defined.
+
diff --git a/svdrp.c b/svdrp.c
index ffdac28b..a01bce34 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.14 2001/02/18 14:18:13 kls Exp $
+ * $Id: svdrp.c 1.15 2001/03/02 22:59:37 kls Exp $
*/
#define _GNU_SOURCE
@@ -535,7 +535,7 @@ void cSVDRP::CmdLSTC(const char *Option)
Reply(250, "%d %s", next->number, next->ToText());
}
}
- else {
+ else if (Channels.MaxNumber() >= 1) {
for (int i = 1; i <= Channels.MaxNumber(); i++) {
cChannel *channel = Channels.GetByNumber(i);
if (channel)
@@ -544,6 +544,8 @@ void cSVDRP::CmdLSTC(const char *Option)
Reply(501, "Channel \"%d\" not found", i);
}
}
+ else
+ Reply(550, "No channels defined");
}
void cSVDRP::CmdLSTT(const char *Option)
@@ -559,7 +561,7 @@ void cSVDRP::CmdLSTT(const char *Option)
else
Reply(501, "Error in timer number \"%s\"", Option);
}
- else {
+ else if (Timers.Count()) {
for (int i = 0; i < Timers.Count(); i++) {
cTimer *timer = Timers.Get(i);
if (timer)
@@ -568,6 +570,8 @@ void cSVDRP::CmdLSTT(const char *Option)
Reply(501, "Timer \"%d\" not found", i + 1);
}
}
+ else
+ Reply(550, "No timers defined");
}
void cSVDRP::CmdMESG(const char *Option)