]> err.no Git - moreutils/commitdiff
* isutf8: Correct inverted exit code when passed a file to check.
authorjoeyh <joeyh>
Wed, 28 Nov 2007 19:19:39 +0000 (19:19 +0000)
committerjoeyh <joeyh>
Wed, 28 Nov 2007 19:19:39 +0000 (19:19 +0000)
Closes: #453306
check-isutf8
debian/changelog
isutf8.c

index d2858d996996acf1660ea8c8a9aa0db2c5be4587..3abb315c7a9592c44f884cf5817dd062f9804f43 100755 (executable)
@@ -17,6 +17,17 @@ check() {
                echo "  got: $ret"
                failed=1
        fi
+       printf "$2" > check-isutf8.tmp.$$ 
+       ./isutf8 -q check-isutf8.tmp.$$
+       ret=$?
+       rm -f check-isutf8.tmp.$$
+       if [ $ret != $1 ]; then
+               echo "Failure (from file):"
+               echo "  input: $2"
+               echo "  expected: $1"
+               echo "  got: $ret"
+               failed=1
+       fi
 }
 
 check 0 ''
index 5fc0d0b5ce0b6bbcdf2b66676daed4b649fcd7b9..1e93cc319b2c80f2cbf9b930ed60422e342df134 100644 (file)
@@ -1,3 +1,10 @@
+moreutils (0.26) UNRELEASED; urgency=low
+
+  * isutf8: Correct inverted exit code when passed a file to check.
+    Closes: #453306
+
+ -- Joey Hess <joeyh@debian.org>  Wed, 28 Nov 2007 14:16:44 -0500
+
 moreutils (0.25) unstable; urgency=low
 
   * isutf8: Detect and reject overlong UTF-8 sequences. Closes: #440951
index 9af7d70bb47ffdbf1fb818887afc3a9c04802b50..4306c7d7a22b230db58248e3317ada4a1f60bb34 100644 (file)
--- a/isutf8.c
+++ b/isutf8.c
@@ -258,7 +258,7 @@ int main(int argc, char **argv) {
                                                strerror(errno));
                                ok = 0;
                        } else {
-                               if (is_utf8_byte_stream(file, argv[i], quiet))
+                               if (is_utf8_byte_stream(file, argv[i], quiet))
                                    ok = 0;
                                (void) fclose(file);
                        }