From 51d4051743df584ff1c1b19b24f600c53b8ed9f2 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 20 Aug 2005 06:36:04 +0000 Subject: [PATCH] Don't quote the program name, windows doesn't like it. Output some useful debugging information. --- includes/GlobalFunctions.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 3c37cb03f7..ddb39ffb91 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -808,6 +808,7 @@ function wfMerge( $old, $mine, $yours, &$result ){ # This check may also protect against code injection in # case of broken installations. if(! file_exists( $wgDiff3 ) ){ + wfDebug( "diff3 not found\n" ); return false; } @@ -822,7 +823,7 @@ function wfMerge( $old, $mine, $yours, &$result ){ fwrite( $yourtextFile, $yours ); fclose( $yourtextFile ); # Check for a conflict - $cmd = wfEscapeShellArg( $wgDiff3 ) . ' -a --overlap-only ' . + $cmd = $wgDiff3 . ' -a --overlap-only ' . wfEscapeShellArg( $mytextName ) . ' ' . wfEscapeShellArg( $oldtextName ) . ' ' . wfEscapeShellArg( $yourtextName ); @@ -836,7 +837,7 @@ function wfMerge( $old, $mine, $yours, &$result ){ pclose( $handle ); # Merge differences - $cmd = wfEscapeShellArg( $wgDiff3 ) . ' -a -e --merge ' . + $cmd = $wgDiff3 . ' -a -e --merge ' . wfEscapeShellArg( $mytextName, $oldtextName, $yourtextName ); $handle = popen( $cmd, 'r' ); $result = ''; @@ -849,6 +850,11 @@ function wfMerge( $old, $mine, $yours, &$result ){ } while ( true ); pclose( $handle ); unlink( $mytextName ); unlink( $oldtextName ); unlink( $yourtextName ); + + if ( $result === '' && $old !== '' && $conflict == false ) { + wfDebug( "Unexpected null result from diff3.\nCommand: $cmd\nOutput: " . `$cmd 2>&1` . "\n" ); + $conflict = true; + } return ! $conflict; } -- 2.20.1