diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-01-07 22:12:50 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-01-07 22:12:50 +0200 |
commit | f70399532bd105c5f42ca040846aa537a8fa27bc (patch) | |
tree | f3d38f73b87fcd8f3078d7bd6879afcff7a97e1c /builtin.c | |
parent | 385f22a32c3794615d713e519ae290eb09b2c4d2 (diff) | |
download | egawk-f70399532bd105c5f42ca040846aa537a8fa27bc.tar.gz egawk-f70399532bd105c5f42ca040846aa537a8fa27bc.tar.bz2 egawk-f70399532bd105c5f42ca040846aa537a8fa27bc.zip |
Fix count$ in printf for dynamic width/precision.
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -904,7 +904,10 @@ check_pos: case '*': if (cur == NULL) break; - if (! do_traditional && isdigit((unsigned char) *s1)) { + if (! do_traditional && used_dollar && ! isdigit((unsigned char) *s1)) { + fatal(_("fatal: must use `count$' on all formats or none")); + break; /* silence warnings */ + } else if (! do_traditional && isdigit((unsigned char) *s1)) { int val = 0; for (; n0 > 0 && *s1 && isdigit((unsigned char) *s1); s1++, n0--) { |