Thread (51 messages) flat view 51 messages, 2 authors, 2016-06-15

Re: [PATCH 09/18] gitweb: Revert reset_output() back to original code

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:50:13

"John 'Warthog9' Hawley" [off-list ref] writes:
Reverted change to reset_output as

	open STDOUT, ">&", \*STDOUT_REAL;
For somebody not following our discussion the above would be very,
very cryptic... though I suppose this would be squashed in final
(ready to be merged in) version of the code.
 
causes assertion failures:

	Assertion !((((s->var)->sv_flags & (0x00004000|0x00008000)) == 0x00008000) && (((svtype)((s->var)->sv_flags & 0xff)) == SVt_PVGV || ((svtype)((s->var)->sv_flags & 0xff)) == SVt_PVLV)) failed: file "scalar.xs", line 49 at gitweb.cgi line 1221.
It looks like bug in Perl, because it should give some kind of Perl
error, not failed assertion from within guts of Perl C code.

Which Perl version are you using?
if we encounter an error *BEFORE* we've ever changed the output.
And how to reproduce this error (i.e. how did you found it)?
 
quoted hunk ↗ jump to hunk
Signed-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
---
 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 1d8bc74..e8c028b 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1225,7 +1225,7 @@ sub change_output {
 
 sub reset_output {
 	# This basically takes STDOUT_REAL and puts it back as STDOUT
-	open STDOUT, ">&", \*STDOUT_REAL;
+	open(STDOUT,">&STDOUT_REAL");
Hmmm... how to silence spurious warning then:

  gitweb.perl: Name "main::STDOUT_REAL" used only once: possible typo
  at ../gitweb/gitweb.perl line 1130.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help