summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b629275)
raw | patch | inline | side by side (parent: b629275)
author | Brian Gernhardt <brian@gernhardtsoftware.com> | |
Mon, 23 Nov 2009 17:33:42 +0000 (12:33 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 24 Nov 2009 06:26:58 +0000 (22:26 -0800) |
Recognizing \r in a regex is something GNU sed will do, but other sed
implementation's won't (e.g. BSD sed on OS X). Instead of two sed
invocations, use a single Perl script to split output into headers
and body.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
implementation's won't (e.g. BSD sed on OS X). Instead of two sed
invocations, use a single Perl script to split output into headers
and body.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/gitweb-lib.sh | patch | blob | history |
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 32b841dd2ea0325c31d8fb52e8fdb6a61fb3af3a..76d8b7b803b4134b65f2d4f624e29223dda2a7ee 100644 (file)
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
rm -f gitweb.log &&
perl -- "$SCRIPT_NAME" \
>gitweb.output 2>gitweb.log &&
- sed -e '/^\r$/q' <gitweb.output >gitweb.headers &&
- sed -e '1,/^\r$/d' <gitweb.output >gitweb.body &&
+ perl -w -e '
+ open O, ">gitweb.headers";
+ while (<>) {
+ print O;
+ last if (/^\r$/ || /^$/);
+ }
+ open O, ">gitweb.body";
+ while (<>) {
+ print O;
+ }
+ close O;
+ ' gitweb.output &&
if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi
# gitweb.log is left for debugging