diff options
author | Jahara <nschimme@gmail.com> | 2009-04-07 19:30:32 (GMT) |
---|---|---|
committer | Kalev Lember <kalev@smartlink.ee> | 2009-04-08 17:58:25 (GMT) |
commit | 70beda9921c1131c178fe404543e8c49f1b48446 (patch) | |
tree | 088e755dabae6da152cb57490b3a9b314a448f18 /cmd2.c | |
parent | 71a0978128c12a4e2b36f3abb07c9070224ad373 (diff) | |
download | powwow-70beda9921c1131c178fe404543e8c49f1b48446.zip powwow-70beda9921c1131c178fe404543e8c49f1b48446.tar.gz powwow-70beda9921c1131c178fe404543e8c49f1b48446.tar.bz2 |
cmd2.c: Fixed setting alias/action groups back to default.
Diffstat (limited to 'cmd2.c')
-rw-r--r-- | cmd2.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -191,11 +191,14 @@ void parse_alias __P1 (char *,str) /* get alias again to add group (if needed) * don't take the lookup penalty though if not changing groups */ - if( group != NULL && *group != '\0' ) { + if( group != NULL ) { np = lookup_alias(left); if( (*np)->group != NULL ) free((*np)->group); + if (*group == '\0') + group = NULL; + (*np)->group = my_strdup(group); } @@ -563,7 +566,7 @@ void parse_action __P2 (char *,str, int,onprompt) type, regexp); } - if( group != NULL && *group != '\0' ) { + if( group != NULL ) { /* I don't know why but we need to clip this because somehow * the original string is restored to *p at some point instead * of the null-clipped one we used waaaay at the top. */ @@ -572,6 +575,10 @@ void parse_action __P2 (char *,str, int,onprompt) np = lookup_action(label); if( (*np)->group != NULL ) free( (*np)->group ); + + if (*group == '\0') + group = NULL; + (*np) -> group = my_strdup( group ); } } |