]> thyrsus.com Git - imgsizer.git/commitdiff
Ready to ship 1.5.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 21 Nov 1998 21:47:48 +0000 (21:47 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 21 Nov 1998 21:47:48 +0000 (21:47 +0000)
Makefile
README
imgsizer

index 054ce953906974b49b9f6fb47a31eeeb10bb90f0..de766ff3462e15b8ea40ba4d4df513dbe1139c5e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ install:
        cp imgsizer httpget $(BINDIR)
        cp imgsizer.man $(MANDIR)/imgsizer.1
 
-DISTDIR = imgsizer-1.2
+DISTDIR = imgsizer-1.5
 FILES = $(DISTDIR)/Makefile $(DISTDIR)/READ.ME $(DISTDIR)/httpget \
        $(DISTDIR)/imgsizer $(DISTDIR)/imgsizer.lsm \
        $(DISTDIR)/imgsizer.man
diff --git a/README b/README
index 2b1c42d209cf617370432531f3dc915b830c1b9a..a475831eda7f1ebdaad8ec0d744d479f02695c53 100644 (file)
--- a/README
+++ b/README
@@ -21,11 +21,11 @@ work.  If you are using Linux or any of the free BSDs it is probably
 already on your system; otherwise, you should be able to get it from
 ftp://ftp.x.org/contrib/applications/ImageMagick.
 
-Usual FRS terms -- copy, use, and redistribute as you like, don't take
-my name off it, and clearly mark any modified versions.  Fixes
-and enhancements cheerfully accepted.  Enjoy!
+Usual open-source terms -- copy, use, and redistribute as you like,
+don't take my name off it, and clearly mark any modified versions.
+Fixes and enhancements cheerfully accepted.  Enjoy!
                                                -- esr
-                                               http://www.ccil.org/~esr
+                                               http://www.tuxedo.org/~esr
 
 
 
index 8e2d1c24565981979032bd69d54729db4a18a91a..f9857c9a71b394829567ad6d85f6ce59083c539d 100755 (executable)
--- a/imgsizer
+++ b/imgsizer
@@ -13,7 +13,7 @@
 # clearly mark an altered version.  Fixes and enhancements cheerfully 
 # accepted.
 #
-# This is version 1.3.
+# This is version 1.5.
 #
 
 # Anything that can fetch a URL defined on the command line 
@@ -34,7 +34,7 @@ if (@ARGV) {
                        select(TEMP);
                        &sizefix;
                        close(TEMP);
-                       if (system("cp $out $file")) {
+                       if (`cmp $out $file` && system("cp $out $file")) {
                                print STDERR "imgsize: couldn't replace ${file}\n}";
                        }
                }
@@ -49,7 +49,7 @@ else {
 sub dirname
 # return filename with the basename part stripped away
 {
-       my($file) = @_;
+       local($file) = @_;
        if ($file =~ /\//) {
                $file =~ s:/[^/]*$::;
        } else {
@@ -114,9 +114,13 @@ sub attrfix
                        return $attribs;
                }
        }
-       elsif (!($url =~ /^[a-z]+:/)) {
-               $image = "$dir/$url";   # This catches local files
-               
+        elsif ($url =~ /^\//) {
+              $image = "./$url";      # This catches local files that are in
+                                     # virtual root, assuming we're called
+                                     # from /var/www or equivalent.
+        }
+        elsif (!($url =~ /^[a-z]+:/)) {
+                $image = "$dir/$url";   # This catches local files
        }
 
        # Don't try to fix up percent sizes