diff options
author | Petr Machata <pmachata@redhat.com> | 2012-10-13 22:18:15 +0200 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-10-14 00:21:12 +0200 |
commit | 83b3189516cab1e42854308f151b2ce5d2dd2364 (patch) | |
tree | d100c76fc5efcf76faa27b761222eb5e68eeaea8 /read_config_file.c | |
parent | f97b187598192f4c1f0ea47369f4e1dd4c08c392 (diff) | |
download | ltrace-83b3189516cab1e42854308f151b2ce5d2dd2364.tar.gz |
Fix handling of arg0 in parameter list
Diffstat (limited to 'read_config_file.c')
-rw-r--r-- | read_config_file.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/read_config_file.c b/read_config_file.c index 87e87e7..75c556a 100644 --- a/read_config_file.c +++ b/read_config_file.c @@ -288,8 +288,7 @@ parse_argnum(char **str, int zero) goto fail; int is_arg = strncmp(name, "arg", 3) == 0; - int is_elt = !is_arg && strncmp(name, "elt", 3) == 0; - if (is_arg || is_elt) { + if (is_arg || strncmp(name, "elt", 3) == 0) { long l; name += 3; if (parse_int(&name, &l) < 0 @@ -297,7 +296,10 @@ parse_argnum(char **str, int zero) goto fail; if (is_arg) { - expr_init_argno(expr, l - 1); + if (l == 0) + expr_init_named(expr, "retval", 0); + else + expr_init_argno(expr, l - 1); } else { struct expr_node *e_up = malloc(sizeof(*e_up)); struct expr_node *e_ix = malloc(sizeof(*e_ix)); |