aboutsummaryrefslogtreecommitdiff
path: root/cmd-confirm-before.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-confirm-before.c')
-rw-r--r--cmd-confirm-before.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd-confirm-before.c b/cmd-confirm-before.c
index e1db383e..eca42b39 100644
--- a/cmd-confirm-before.c
+++ b/cmd-confirm-before.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-confirm-before.c,v 1.9 2009-07-28 22:12:16 tcunha Exp $ */
+/* $Id: cmd-confirm-before.c,v 1.10 2009-08-16 19:29:24 tcunha Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -107,7 +107,9 @@ cmd_confirm_before_callback(void *data, const char *s)
struct cmd_ctx ctx;
char *cause;
- if (s == NULL || tolower((u_char) s[0]) != 'y' || s[1] != '\0')
+ if (s == NULL || *s == '\0')
+ return (0);
+ if (tolower((u_char) s[0]) != 'y' || s[1] != '\0')
return (0);
if (cmd_string_parse(cdata->cmd, &cmdlist, &cause) != 0) {