0
  +   ˆl–Ðz¾”ªeJ‚ÆÜ¸”Å£Á697_‡5#˜¬LiÁÅ ¹    GIF89a, ) Õ  Ì  Ë	   ÿÿÿ™  ˜  f  ³  3  Y  ¿  ÏÏÏs  ¦  3
ïïï@  Îßßß&  ¾Œ  ?f¥í¨¦¯¯¯¿¿¿Y   õÒÑ€  M  L000pppòÃÂ&ŸŸŸ  Õ=7PPPüððè–“ßjeØLG²���€€€|pp@@@r	âyuµÅ†  =00åˆ„Ò.(!ù     ,    , )  ÿ@€pH,�È¤rÉl:ŸÐ¨T¨Z¯Ø¬vk-rµ³‚¸`ùj½æ £¸ß›']Es!›·~ÿ˜›íY3{o		,zD[mn%Bze[€V�z“E%z\ yo	–“¸{!Ÿ�X&{
§n
Fªzg¿V„ 
¤F{ÌCXn˜ÇLÅoY€nDK{çÍjnE$nG*è¡·ÍJ0$J%(ä¯”�Å–]4H€�wE¦%Š–d“ X ©(tI.%Ü,šX�5))¬ìRo¤6xTkOfÈÖzß¬0 Ç�†K”ûY°Jˆ=4ˆR p¢BŒFH,|#‘fS{\|ø ‚ÑN¼9$AB�{4rÅÂY¢PÜð�ˆ (0`Pƒ�‰¹ °tØË¸ñ€„ºz¥{å‡ã½5<ˆ`@TŸ ;˜R¾âãò]C€à‚3ZÚF_azoZÎæðõÕÊÚµ‰¢pM´C«zW~�`ö¬ñã½“Ã~öEFÑ±ÈH¼Ã„4®´´€Áýî‹1¾Ó	oFF:ˆáËÿ2¥¾ýûøóë¿ ;  "   ˆl–Ü4ý( ©³( 	Å€fàB¦-ÿÃƒl.½ÂÆ :    #!/usr/bin/perl
# SPDX-License-Identifier: GPL-2.0
#
# Clean a patch file -- or directory of patch files -- of stealth whitespace.
# WARNING: this can be a highly destructive operation.  Use with caution.
#

use warnings;
use bytes;
use File::Basename;

# Default options
$max_width = 79;

# Clean up space-tab sequences, either by removing spaces or
# replacing them with tabs.
sub clean_space_tabs($)
{
    no bytes;			# Tab alignment depends on characters

    my($li) = @_;
    my($lo) = '';
    my $pos = 0;
    my $nsp = 0;
    my($i, $c);

    for ($i = 0; $i < length($li); $i++) {
	$c = substr($li, $i, 1);
	if ($c eq "\t") {
	    my $npos = ($pos+$nsp+8) & ~7;
	    my $ntab = ($npos >> 3) - ($pos >> 3);
	    $lo .= "\t" x $ntab;
	    $pos = $npos;
	    $nsp = 0;
	} elsif ($c eq "\n" || $c eq "\r") {
	    $lo .= " " x $nsp;
	    $pos += $nsp;
	    $nsp = 0;
	    $lo .= $c;
	    $pos = 0;
	} elsif ($c eq " ") {
	    $nsp++;
	} else {
	    $lo .= " " x $nsp;
	    $pos += $nsp;
	    $nsp = 0;
	    $lo .= $c;
	    $pos++;
	}
    }
    $lo .= " " x $nsp;
    return $lo;
}

# Compute the visual width of a string
sub strwidth($) {
    no bytes;			# Tab alignment depends on characters

    my($li) = @_;
    my($c, $i);
    my $pos = 0;
    my $mlen = 0;

    for ($i = 0; $i < length($li); $i++) {
	$c = substr($li,$i,1);
	if ($c eq "\t") {
	    $pos = ($pos+8) & ~7;
	} elsif ($c eq "\n") {
	    $mlen = $pos if ($pos > $mlen);
	    $pos = 0;
	} else {
	    $pos++;
	}
    }

    $mlen = $pos if ($pos > $mlen);
    return $mlen;
}

$name = basename($0);

@files = ();

while (defined($a = shift(@ARGV))) {
    if ($a =~ /^-/) {
	if ($a eq '-width' || $a eq '-w') {
	    $max_width = shift(@ARGV)+0;
	} else {
	    print STDERR "Usage: $name [-width #] files...\n";
	    exit 1;
	}
    } else {
	push(@files, $a);
    }
}

foreach $f ( @files ) {
    print STDERR "$name: $f\n";

    if (! -f $f) {
	print STDERR "$f: not a file\n";
	next;
    }

    if (!open(FILE, '+<', $f)) {
	print STDERR "$name: Cannot open file: $f: $!\n";
	next;
    }

    binmode FILE;

    # First, verify that it is not a binary file; consider any file
    # with a zero byte to be a binary file.  Is there any better, or
    # additional, heuristic that should be applied?
    $is_binary = 0;

    while (read(FILE, $data, 65536) > 0) {
	if ($data =~ /\0/) {
	    $is_binary = 1;
	    last;
	}
    }

    if ($is_binary) {
	print STDERR "$name: $f: binary file\n";
	next;
    }

    seek(FILE, 0, 0);

    $in_bytes = 0;
    $out_bytes = 0;
    $lineno = 0;

    @lines  = ();

    $in_hunk = 0;
    $err = 0;

    while ( defined($line = <FILE>) ) {
	$lineno++;
	$in_bytes += length($line);

	if (!$in_hunk) {
	    if ($line =~
		/^\@\@\s+\-([0-9]+),([0-9]+)\s+\+([0-9]+),([0-9]+)\s\@\@/) {
		$minus_lines = $2;
		$plus_lines = $4;
		if ($minus_lines || $plus_lines) {
		    $in_hunk = 1;
		    @hunk_lines = ($line);
		}
	    } else {
		push(@lines, $line);
		$out_bytes += length($line);
	    }
	} else {
	    # We're in a hunk

	    if ($line =~ /^\+/) {
		$plus_lines--;

		$text = substr($line, 1);
		$text =~ s/[ \t\r]*$//;		# Remove trailing spaces
		$text = clean_space_tabs($text);

		$l_width = strwidth($text);
		if ($max_width && $l_width > $max_width) {
		    print STDERR
			