diff options
Diffstat (limited to 'dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch')
-rw-r--r-- | dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch b/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch new file mode 100644 index 000000000000..911a31b21bf3 --- /dev/null +++ b/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch @@ -0,0 +1,75 @@ +--- colorgcc.r9 2003-09-21 12:14:48.000000000 -0700 ++++ colorgcc 2003-09-21 13:11:22.000000000 -0700 +@@ -95,6 +95,7 @@ + use Cwd 'abs_path'; + + my(%nocolor, %colors, %compilerPaths); ++my($unfinishedQuote, $previousColor); + + sub initDefaults + { +@@ -159,14 +160,37 @@ + + my($line, $normalColor) = @_; + ++ if (defined $normalColor) ++ { ++ $previousColor = $normalColor; ++ } ++ else ++ { ++ $normalColor = $previousColor; ++ } ++ + my($srcon) = color("reset") . $colors{"srcColor"}; + my($srcoff) = color("reset") . $normalColor; + +- $line = $normalColor . $line; ++ $line = ($unfinishedQuote? $srcon : $normalColor) . $line; + +- # This substitute replaces `foo' with `AfooB' where A is the escape ++ # These substitutions replaces `foo' with `AfooB' where A is the escape + # sequence that turns on the the desired source color, and B is the + # escape sequence that returns to $normalColor. ++ ++ # Handle multi-line quotes. ++ if ($unfinishedQuote) { ++ if ($line =~ s/^([^\`]*?)\'/$1$srcoff\'/) ++ { ++ $unfinishedQuote = 0; ++ } ++ } ++ if ($line =~ s/\`([^\']*?)$/\`$srcon$1/) ++ { ++ $unfinishedQuote = 1; ++ } ++ ++ # Single line quoting. + $line =~ s/\`(.*?)\'/\`$srcon$1$srcoff\'/g; + + print($line, color("reset")); +@@ -190,6 +214,10 @@ + loadPreferences('/etc/colorgcc/colorgccrc'); + } + ++# Set our default output color. This presumes that any unrecognized output ++# is an error. ++$previousColor = $colors{"errorMessageColor"}; ++ + # Figure out which compiler to invoke based on our program name. + $0 =~ m%.*/(.*)$%; + my $progName = $1 || $0; +@@ -281,10 +309,9 @@ + # No line number, treat as an "introductory" line of text. + srcscan($_, $colors{"introColor"}); + } +- else # Anything else. ++ else # Anything else. + { +- # Doesn't seem to be a warning or an error. Print normally. +- print(color("reset"), $_); ++ srcscan($_, undef); + } + } + + |