Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c9a37bec
Commit
c9a37bec
authored
May 02, 2008
by
msvensson@pilot.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the "diff tool" detection algoritm to use "diff -u", "diff -c" and
then just "diff"
parent
8c97dc80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
client/mysqltest.c
client/mysqltest.c
+10
-12
No files found.
client/mysqltest.c
View file @
c9a37bec
...
...
@@ -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'"
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment