From 370aeec44d2230ba8ee86abaeb81f14e543e0375 Mon Sep 17 00:00:00 2001 From: liljencrantz Date: Sun, 9 Sep 2007 23:57:34 +1000 Subject: [PATCH] Fix bug in the count builtin, causing it to exit with status 0 even if no arguments where given darcs-hash:20070909135734-75c98-2d0495a15440e50fb6521bffef85147832771c80.gz --- builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin.c b/builtin.c index 0aff1d7e3..edcc5bb0a 100644 --- a/builtin.c +++ b/builtin.c @@ -2363,7 +2363,7 @@ static int builtin_count( wchar_t ** argv ) int argc; argc = builtin_count_args( argv ); sb_printf( sb_out, L"%d\n", argc-1 ); - return !argc; + return !(argc-1); } static int builtin_contains( wchar_t ** argv )