From adbaa54ad43ffb3fd436704d621fe0df9562987b Mon Sep 17 00:00:00 2001 From: Thorsten Schöning Date: Mon, 23 Nov 2015 10:50:10 +0100 Subject: Fix non-portable use of /dev/null /dev/null is not portable, so use File::Spec instead, which provides portable "paths" and especially "nul" on Windows. I changed all places with hard coded /dev/null to be sure, while I think it only is a problem in direct system calls, because the other executed commands go to sh.exe from MSYS which itself should port /dev/null to NUL. The test still pass, so shouldn't have made any harm... --- qpdf/qtest/qpdf.test | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test index cfb3fa0d..8d4f0638 100644 --- a/qpdf/qtest/qpdf.test +++ b/qpdf/qtest/qpdf.test @@ -2,10 +2,11 @@ require 5.008; BEGIN { $^W = 1; } use strict; -use File::Copy; -use File::Basename; use Cwd; use Digest::MD5; +use File::Basename; +use File::Copy; +use File::Spec; chdir("qpdf") or die "chdir testdir failed: $!\n"; @@ -13,6 +14,7 @@ require TestDriver; cleanup(); +my $devNull = File::Spec->devnull(); my $td = new TestDriver('qpdf'); my $compare_images = 1; @@ -29,7 +31,7 @@ if ($compare_images) { # check for working acroread if (system("acroread -toPostScript -pairs good1.pdf a.ps" . - " >/dev/null 2>&1") == 0) + " >$devNull 2>&1") == 0) { $have_acroread = 1; } @@ -2247,7 +2249,7 @@ sub compare_pdfs $td->runtest("convert original file to image", {$td->COMMAND => "(cd tif1;" . - " gs 2>/dev/null -q -dNOPAUSE -sDEVICE=tiff24nc" . + " gs 2>$devNull -q -dNOPAUSE -sDEVICE=tiff24nc" . " -sOutputFile=a.tif - < ../$f1)"}, {$td->STRING => "", $td->EXIT_STATUS => 0}); @@ -2266,7 +2268,7 @@ sub compare_pdfs $td->runtest("convert new file to image", {$td->COMMAND => "(cd tif2;" . - " gs 2>/dev/null -q -dNOPAUSE -sDEVICE=tiff24nc" . + " gs 2>$devNull -q -dNOPAUSE -sDEVICE=tiff24nc" . " -sOutputFile=a.tif - < ../$f2)"}, {$td->STRING => "", $td->EXIT_STATUS => 0}); -- cgit v1.2.3-54-g00ecf