From 291f2bfd4289db9199cb427a86b0c7f47758f202 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Mon, 28 Jan 2008 17:34:06 -0800 Subject: handle empty action --- src/cli_def.l | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/cli_def.l b/src/cli_def.l index c90b3c3..71bd71f 100644 --- a/src/cli_def.l +++ b/src/cli_def.l @@ -85,11 +85,9 @@ append_str(char *text) static int return_action() { - if (action_ptr != action_buf) { - *action_ptr = 0; - yy_cli_parse_lval.strp = strdup(action_buf); - action_ptr = action_buf; - } + *action_ptr = 0; + yy_cli_parse_lval.strp = strdup(action_buf); + action_ptr = action_buf; return STRING; } -- cgit v1.2.3