From: Jim Meyering Date: Sat, 10 May 2003 20:27:16 +0000 (+0000) Subject: (main): Handle argc == 0. X-Git-Tag: COREUTILS-5_0_1~530 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fd6d22880267a644085097791a78b7bfcc42e1b;p=platform%2Fupstream%2Fcoreutils.git (main): Handle argc == 0. --- diff --git a/src/basename.c b/src/basename.c index aa0e141..1f0d682 100644 --- a/src/basename.c +++ b/src/basename.c @@ -1,5 +1,5 @@ /* basename -- strip directory and suffix from filenames - Copyright (C) 1990-1997, 1999-2002 Free Software Foundation, Inc. + Copyright (C) 1990-1997, 1999-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -109,9 +109,9 @@ main (int argc, char **argv) ++argv; } - if (argc == 1 || argc > 3) + if (argc <= 1 || argc > 3) { - error (0, 0, (argc == 1 ? _("too few arguments") + error (0, 0, (argc <= 1 ? _("too few arguments") : _("too many arguments"))); usage (EXIT_FAILURE); }