[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1346419090-3808-4-git-send-email-cruzjbishop@gmail.com>
Date: Fri, 31 Aug 2012 23:18:09 +1000
From: Cruz Julian Bishop <cruzjbishop@...il.com>
To: mcgrof@...il.com
Cc: linux-kernel@...r.kernel.org,
Cruz Julian Bishop <cruzjbishop@...il.com>
Subject: [PATCH 3/4] scripts/checkincludes.pl: Fix a bug introduced in the last commit
Since the previous commit, simply specifying -r without any files
caused no message to be displayed.
Before said commit, the usage() function was called.
This commit simply calls the usage() function if no files were
specified - This includes once other arguments are supported.
Signed-off-by: Cruz Julian Bishop <cruzjbishop@...il.com>
---
scripts/checkincludes.pl | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/checkincludes.pl b/scripts/checkincludes.pl
index 7d713c2..cde7ce1 100755
--- a/scripts/checkincludes.pl
+++ b/scripts/checkincludes.pl
@@ -30,12 +30,16 @@ if ($#ARGV < 0) {
usage();
}
+my $argc = 0;
+
foreach my $arg (@ARGV) {
if ($arg eq "-r") {
$remove = 1;
} else {
open(my $f, '<', $arg)
or die "Cannot open $arg: $!.\n";
+
+ $argc++;
my %includedfiles = ();
my @file_lines = ();
@@ -84,3 +88,7 @@ foreach my $arg (@ARGV) {
close($f);
}
}
+
+if ($argc == 0) {
+ usage();
+}
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists