[interchange] Fix unintentionally short local scoping
David Christensen
interchange-cvs at icdevgroup.org
Tue Nov 14 20:47:31 UTC 2017
commit b6ebec3b90f69f6437991c1fc3f6fbe52d1f3cc4
Author: David Christensen <david at endpoint.com>
Date: Mon Nov 13 15:34:23 2017 -0600
Fix unintentionally short local scoping
lib/Vend/File.pm | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/lib/Vend/File.pm b/lib/Vend/File.pm
index b749e1e..475e15b 100644
--- a/lib/Vend/File.pm
+++ b/lib/Vend/File.pm
@@ -96,10 +96,8 @@ sub writefile {
}
# We have checked for beginning > or | previously
open(MVLOGDATA, $file) or die "open\n";
- if ($encoding) {
- local $PerlIO::encoding::fallback = $fallback;
- binmode(MVLOGDATA, ":encoding($encoding)");
- }
+ local $PerlIO::encoding::fallback = $fallback if $encoding;
+ binmode(MVLOGDATA, ":encoding($encoding)") if $encoding;
lockfile(\*MVLOGDATA, 1, 1) or die "lock\n";
seek(MVLOGDATA, 0, 2) or die "seek\n";
More information about the interchange-cvs
mailing list