aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-08-01 18:12:52 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-08-01 18:12:52 +0000
commit91dcb8fa34db2acb9254ef3dd5575436e7ee1467 (patch)
tree6da97a76fa900eb05a43bc83e93d732df09f1bda /asterisk.c
parent1b705fdbac7350bd91735484c315ae56f0c73998 (diff)
Don't record empty lines (bug #2175, but not using proposed patch)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3561 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-xasterisk.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/asterisk.c b/asterisk.c
index 29a105ba8..575ddbcb1 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -654,12 +654,22 @@ static void console_verboser(const char *s, int pos, int replace, int complete)
pthread_kill(consolethread, SIGURG);
}
+static int ast_all_zeros(char *s)
+{
+ while(*s) {
+ if (*s > 32)
+ return 0;
+ s++;
+ }
+ return 1;
+}
+
static void consolehandler(char *s)
{
printf(term_end());
fflush(stdout);
/* Called when readline data is available */
- if (s && !ast_strlen_zero(s))
+ if (s && !ast_all_zeros(s))
ast_el_add_history(s);
/* Give the console access to the shell */
if (s) {