diff options
Diffstat (limited to 'coreutils/expr.c')
| -rw-r--r-- | coreutils/expr.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/coreutils/expr.c b/coreutils/expr.c index 71bd22417..8ef5293c1 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
| @@ -76,14 +76,14 @@ int expr_main (int argc, char **argv) | |||
| 76 | VALUE *v; | 76 | VALUE *v; |
| 77 | 77 | ||
| 78 | if (argc == 1) { | 78 | if (argc == 1) { |
| 79 | error_msg_and_die("too few arguments\n"); | 79 | error_msg_and_die("too few arguments"); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | args = argv + 1; | 82 | args = argv + 1; |
| 83 | 83 | ||
| 84 | v = eval (); | 84 | v = eval (); |
| 85 | if (*args) | 85 | if (*args) |
| 86 | error_msg_and_die ("syntax error\n"); | 86 | error_msg_and_die ("syntax error"); |
| 87 | 87 | ||
| 88 | if (v->type == integer) | 88 | if (v->type == integer) |
| 89 | printf ("%d\n", v->u.i); | 89 | printf ("%d\n", v->u.i); |
| @@ -218,7 +218,7 @@ static \ | |||
| 218 | int name (l, r) VALUE *l; VALUE *r; \ | 218 | int name (l, r) VALUE *l; VALUE *r; \ |
| 219 | { \ | 219 | { \ |
| 220 | if (!toarith (l) || !toarith (r)) \ | 220 | if (!toarith (l) || !toarith (r)) \ |
| 221 | error_msg_and_die ("non-numeric argument\n"); \ | 221 | error_msg_and_die ("non-numeric argument"); \ |
| 222 | return l->u.i op r->u.i; \ | 222 | return l->u.i op r->u.i; \ |
| 223 | } | 223 | } |
| 224 | 224 | ||
| @@ -226,9 +226,9 @@ int name (l, r) VALUE *l; VALUE *r; \ | |||
| 226 | int name (l, r) VALUE *l; VALUE *r; \ | 226 | int name (l, r) VALUE *l; VALUE *r; \ |
| 227 | { \ | 227 | { \ |
| 228 | if (!toarith (l) || !toarith (r)) \ | 228 | if (!toarith (l) || !toarith (r)) \ |
| 229 | error_msg_and_die ( "non-numeric argument\n"); \ | 229 | error_msg_and_die ( "non-numeric argument"); \ |
| 230 | if (r->u.i == 0) \ | 230 | if (r->u.i == 0) \ |
| 231 | error_msg_and_die ( "division by zero\n"); \ | 231 | error_msg_and_die ( "division by zero"); \ |
| 232 | return l->u.i op r->u.i; \ | 232 | return l->u.i op r->u.i; \ |
| 233 | } | 233 | } |
| 234 | 234 | ||
| @@ -272,7 +272,7 @@ of a basic regular expression is not portable; it is being ignored", | |||
| 272 | re_syntax_options = RE_SYNTAX_POSIX_BASIC; | 272 | re_syntax_options = RE_SYNTAX_POSIX_BASIC; |
| 273 | errmsg = re_compile_pattern (pv->u.s, len, &re_buffer); | 273 | errmsg = re_compile_pattern (pv->u.s, len, &re_buffer); |
| 274 | if (errmsg) { | 274 | if (errmsg) { |
| 275 | error_msg_and_die("%s\n", errmsg); | 275 | error_msg_and_die("%s", errmsg); |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs); | 278 | len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs); |
| @@ -303,19 +303,19 @@ static VALUE *eval7 (void) | |||
| 303 | VALUE *v; | 303 | VALUE *v; |
| 304 | 304 | ||
| 305 | if (!*args) | 305 | if (!*args) |
| 306 | error_msg_and_die ( "syntax error\n"); | 306 | error_msg_and_die ( "syntax error"); |
| 307 | 307 | ||
| 308 | if (nextarg ("(")) { | 308 | if (nextarg ("(")) { |
| 309 | args++; | 309 | args++; |
| 310 | v = eval (); | 310 | v = eval (); |
| 311 | if (!nextarg (")")) | 311 | if (!nextarg (")")) |
| 312 | error_msg_and_die ( "syntax error\n"); | 312 | error_msg_and_die ( "syntax error"); |
| 313 | args++; | 313 | args++; |
| 314 | return v; | 314 | return v; |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | if (nextarg (")")) | 317 | if (nextarg (")")) |
| 318 | error_msg_and_die ( "syntax error\n"); | 318 | error_msg_and_die ( "syntax error"); |
| 319 | 319 | ||
| 320 | return str_value (*args++); | 320 | return str_value (*args++); |
| 321 | } | 321 | } |
| @@ -329,7 +329,7 @@ static VALUE *eval6 (void) | |||
| 329 | if (nextarg ("quote")) { | 329 | if (nextarg ("quote")) { |
| 330 | args++; | 330 | args++; |
| 331 | if (!*args) | 331 | if (!*args) |
| 332 | error_msg_and_die ( "syntax error\n"); | 332 | error_msg_and_die ( "syntax error"); |
| 333 | return str_value (*args++); | 333 | return str_value (*args++); |
| 334 | } | 334 | } |
| 335 | else if (nextarg ("length")) { | 335 | else if (nextarg ("length")) { |
