summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorMagnus Svensson <msvensson@mysql.com>2008-06-19 10:10:37 +0200
committerMagnus Svensson <msvensson@mysql.com>2008-06-19 10:10:37 +0200
commitdbb0e6ad71105c30373ad125ed1e9bdd3298f76a (patch)
tree720343c9f195673fa0718b63f8b3b080cfea9c0b /client
parent8b7a3b972f999f9d5d9a29ada24c4ee475620785 (diff)
parent10968f73a18ae542e8691099ff64bfead32363c3 (diff)
downloadmariadb-git-dbb0e6ad71105c30373ad125ed1e9bdd3298f76a.tar.gz
Merge parallel mtr
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 31d85c36ed1..aea64c88247 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -1345,23 +1345,21 @@ void show_diff(DYNAMIC_STRING* ds,
if (init_dynamic_string(&ds_tmp, "", 256, 256))
die("Out of memory");
- /* First try with diff --help to see if the command exists at all */
+ /* First try with unified diff */
if (run_tool("diff",
&ds_tmp, /* Get output from diff in ds_tmp */
- "--help",
+ "-u",
+ filename1,
+ filename2,
"2>&1",
- NULL) != 0) /* Most "diff --help" tools return 0 */
- {
- diff_failed= "You don't appear to have diff installed";
- }
- else
+ NULL) > 1) /* Most "diff" tools return >1 if error */
{
dynstr_set(&ds_tmp, "");
- /* First try with unified diff */
+ /* Fallback to context diff with "diff -c" */
if (run_tool("diff",
&ds_tmp, /* Get output from diff in ds_tmp */
- "-u",
+ "-c",
filename1,
filename2,
"2>&1",
@@ -1369,17 +1367,17 @@ void show_diff(DYNAMIC_STRING* ds,
{
dynstr_set(&ds_tmp, "");
- /* Fallback to context diff with "diff -c" */
+ /* Fallback to plain "diff" */
if (run_tool("diff",
&ds_tmp, /* Get output from diff in ds_tmp */
- "-c",
filename1,
filename2,
"2>&1",
NULL) > 1) /* Most "diff" tools return >1 if error */
{
dynstr_set(&ds_tmp, "");
- diff_failed= "Could not execute 'diff -u' or 'diff -c'";
+
+ diff_failed= "Could not execute 'diff -u', 'diff -c' or 'diff'";
}
}
}