]> thyrsus.com Git - imgsizer.git/commitdiff
Avoid lossage when called on multiple files.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 12 Oct 1996 01:53:03 +0000 (01:53 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 12 Oct 1996 01:53:03 +0000 (01:53 +0000)
imgsizer

index c731dff00cb04587ae9ec813526d9e9043a4d63e..a53bba8f9da8364950f29442e3ac28de25c13911 100755 (executable)
--- a/imgsizer
+++ b/imgsizer
@@ -43,7 +43,7 @@ else {
 
 sub getchar
 {
-       $pushback = <> if (length($pushback) == 0);
+       $pushback = <STDIN> if (length($pushback) == 0);
        $char = substr($pushback, 0, 1);
        $pushback = substr($pushback,1);
        return $char;
@@ -53,7 +53,7 @@ sub getchar
 sub sizefix
 # Apply attrfix to the attributes in each image tag
 {
-       while (<>) {
+       while (<STDIN>) {
                while (/<IMG\s+/i) {
                        print $`; print $&;
                        flush;
@@ -82,7 +82,7 @@ sub attrfix
         $attribs = $_[0];
 
        if (!($attribs =~ /SRC="([^"]*)"/i)) {
-               &error("image '${attribs}' has no SRC attribute");
+               &error("image \"${attribs}\"' has no SRC attribute");
                return $attribs;
        }
        $url = $1;