Module Name:    src
Committed By:   jmmv
Date:           Mon Dec  6 18:04:02 UTC 2010

Modified Files:
        src/external/bsd/atf/dist/atf-sh: atf-check.cpp atf-check_test.sh

Log Message:
Pull up revision c917871de7dd67ba57c17496ad68fe4e4aa8b239:

Fix atf-check match checker to validate lines without newline

Problem found by po...@.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-sh/atf-check.cpp
cvs rdiff -u -r1.1.1.2 -r1.2 \
    src/external/bsd/atf/dist/atf-sh/atf-check_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/atf-check.cpp
diff -u src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.2 src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.3
--- src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.2	Fri Nov 26 12:04:36 2010
+++ src/external/bsd/atf/dist/atf-sh/atf-check.cpp	Mon Dec  6 18:04:02 2010
@@ -378,7 +378,7 @@
     bool found = false;
 
     std::string line;
-    while (!found && std::getline(stream, line).good()) {
+    while (!found && !std::getline(stream, line).fail()) {
         if (atf::text::match(line, regexp))
             found = true;
     }

Index: src/external/bsd/atf/dist/atf-sh/atf-check_test.sh
diff -u src/external/bsd/atf/dist/atf-sh/atf-check_test.sh:1.1.1.2 src/external/bsd/atf/dist/atf-sh/atf-check_test.sh:1.2
--- src/external/bsd/atf/dist/atf-sh/atf-check_test.sh:1.1.1.2	Sun Nov  7 17:43:29 2010
+++ src/external/bsd/atf/dist/atf-sh/atf-check_test.sh	Mon Dec  6 18:04:02 2010
@@ -234,6 +234,7 @@
 }
 oflag_match_body()
 {
+    h_pass "printf no-newline" -o "match:^no-newline"
     h_pass "echo line1; echo foo bar" -o "match:^foo"
     h_pass "echo foo bar" -o "match:o b"
     h_fail "echo foo bar" -o "match:baz"
@@ -365,6 +366,7 @@
 }
 eflag_match_body()
 {
+    h_pass "printf no-newline 1>&2" -e "match:^no-newline"
     h_pass "echo line1 1>&2; echo foo bar 1>&2" -e "match:^foo"
     h_pass "echo foo bar 1>&2" -e "match:o b"
     h_fail "echo foo bar 1>&2" -e "match:baz"

Reply via email to