summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2015-08-03 14:07:14 +0300
committerRobert Mustacchi <rm@joyent.com>2015-08-07 10:28:14 -0700
commit94385aa447e04fc3f80a94bb4639c652babf5664 (patch)
treea154abaeaa175d1b7bcc202df8330816d22ffbfc
parenta87701e9837f8a9ee9e4c4d3186295c0e29f743f (diff)
downloadillumos-joyent-94385aa447e04fc3f80a94bb4639c652babf5664.tar.gz
6095 usr/src/tools/scripts/cstyle.pl errors with perl 5.22
Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Marcel Telka <marcel.telka@nexenta.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Richard PALO <richard@netbsd.org> Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/tools/scripts/cstyle.pl22
1 files changed, 17 insertions, 5 deletions
diff --git a/usr/src/tools/scripts/cstyle.pl b/usr/src/tools/scripts/cstyle.pl
index 9f67b1d2e4..7cbd7a4a1b 100644
--- a/usr/src/tools/scripts/cstyle.pl
+++ b/usr/src/tools/scripts/cstyle.pl
@@ -19,12 +19,12 @@
#
# CDDL HEADER END
#
+# Copyright 2015 Toomas Soome <tsoome@me.com>
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# @(#)cstyle 1.58 98/09/09 (from shannon)
-#ident "%Z%%M% %I% %E% SMI"
#
# cstyle - check for some common stylistic errors.
#
@@ -191,7 +191,11 @@ my $no_errs = 0; # set for CSTYLED-protected lines
sub err($) {
my ($error) = @_;
unless ($no_errs) {
- printf $fmt, $filename, $., $error, $line;
+ if ($verbose) {
+ printf $fmt, $filename, $., $error, $line;
+ } else {
+ printf $fmt, $filename, $., $error;
+ }
$err_stat = 1;
}
}
@@ -200,7 +204,11 @@ sub err_prefix($$) {
my ($prevline, $error) = @_;
my $out = $prevline."\n".$line;
unless ($no_errs) {
- printf $fmt, $filename, $., $error, $out;
+ if ($verbose) {
+ printf $fmt, $filename, $., $error, $out;
+ } else {
+ printf $fmt, $filename, $., $error;
+ }
$err_stat = 1;
}
}
@@ -208,7 +216,11 @@ sub err_prefix($$) {
sub err_prev($) {
my ($error) = @_;
unless ($no_errs) {
- printf $fmt, $filename, $. - 1, $error, $prev;
+ if ($verbose) {
+ printf $fmt, $filename, $. - 1, $error, $prev;
+ } else {
+ printf $fmt, $filename, $. - 1, $error;
+ }
$err_stat = 1;
}
}
@@ -604,7 +616,7 @@ line: while (<$filehandle>) {
if (/^\s*\(void\)[^ ]/) {
err("missing space after (void) cast");
}
- if (/\S{/ && !/{{/) {
+ if (/\S\{/ && !/\{\{/) {
err("missing space before left brace");
}
if ($in_function && /^\s+{/ &&