summaryrefslogtreecommitdiff
path: root/svdrp.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2016-12-08 09:53:01 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2016-12-08 09:53:01 +0100
commitce6c90a4506a80bf7e8fa55d2ab643478e97183f (patch)
tree48f009b5e692a11f1dc63a79b72979e369b5dd95 /svdrp.c
parent1172937e8a3820d93a790510e36cd6eb5671ebb9 (diff)
downloadvdr-ce6c90a4506a80bf7e8fa55d2ab643478e97183f.tar.gz
vdr-ce6c90a4506a80bf7e8fa55d2ab643478e97183f.tar.bz2
The SVDRP command DELC now refuses to delete the very last channel in the list
Diffstat (limited to 'svdrp.c')
-rw-r--r--svdrp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/svdrp.c b/svdrp.c
index 1a24d296..81768e3e 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 4.9 2015/09/14 13:23:06 kls Exp $
+ * $Id: svdrp.c 4.10 2016/12/08 09:51:02 kls Exp $
*/
#include "svdrp.h"
@@ -1228,6 +1228,10 @@ void cSVDRPServer::CmdDELC(const char *Option)
int n = Channels->GetNextNormal(CurrentChannel->Index());
if (n < 0)
n = Channels->GetPrevNormal(CurrentChannel->Index());
+ if (n < 0) {
+ Reply(501, "Can't delete channel \"%s\" - list would be empty", Option);
+ return;
+ }
CurrentChannel = Channels->Get(n);
CurrentChannelNr = 0; // triggers channel switch below
}