summaryrefslogtreecommitdiff
path: root/src/diff3.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-01-05 07:08:23 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-01-05 07:08:23 +0000
commit91b8605708cf2d7c49679a46a80b4039167da2cd (patch)
tree6972aba10c298cc28c3511b03647ead2ddc42765 /src/diff3.c
parent174ab8396535806d77708990568f9817d11d5bb3 (diff)
downloaddiffutils-91b8605708cf2d7c49679a46a80b4039167da2cd.tar.gz
* src/cmp.c: Don't include <setmode.h>.
(specify_ignore_initial): Reword to avoid gcc -W warnings. (main): Use freopen instead of setmode, since freopen is in POSIX. * src/context.c: Revert most 2004-09-01 changes. Then: (TIMESPEC_NS): Remove. All uses replaced by get_stat_mtime_ns. Include stat-time.h, strftime.h. (nstrtime): Remove decl. * src/diff.c: Revert most 2004-09-01 changes. Then: Don't include <posixver.h>, <quotesys.h>, <setmode.h>. Include <sh-quote.h>, <stat-time.h>, <timespec.h>. All uses of quotesys replaced by sh-quote. (main, compare_files): Use freopen instead of setmode, since freopen is in POSIX. (main): Don't complain about "diff -NUM'. (main, set_mtime_to_now): Adjust to stat-time.h macros when accessing nanoseconds. * src/diff3.c: Include sh-quote.h rather than quotesys. All uses changed. * src/dir.c (dir_read): excluded_filename renamed to excluded_file_name. * src/io.c: Don't include <setmode.h>. (sip, read_files): Remove binary file stuff, leaving a FIXME behind. A DOS expert needs to look at this. * src/diff.c: Include sh-quote.h rather than quotesys.h. All uses changed. * src/system.h: Include verify.h. (verify): Remove. All uses changed to verify.h version. Include <intprops.h>. (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove. Now uses intprops.h versions. (O_BINARY): New defns, taken from coreutils. * src/util.c: Include sh-quote.h rather than quotesys.h. All uses changed.
Diffstat (limited to 'src/diff3.c')
-rw-r--r--src/diff3.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/diff3.c b/src/diff3.c
index 261eeab..531c949 100644
--- a/src/diff3.c
+++ b/src/diff3.c
@@ -1,7 +1,7 @@
/* diff3 - compare three files line by line
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1998, 2001,
- 2002, 2004 Free Software Foundation, Inc.
+ 2002, 2004, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
#include <file-type.h>
#include <getopt.h>
#include <inttostr.h>
-#include <quotesys.h>
+#include <sh-quote.h>
#include <version-etc.h>
#include <xalloc.h>
@@ -1192,14 +1192,14 @@ read_diff (char const *filea,
FILE *fpipe;
char const args[] = " --horizon-lines=100 -- ";
- char *command = xmalloc (quote_system_arg (0, diff_program)
+ char *command = xmalloc (shell_quote_length (diff_program)
+ sizeof "-a"
+ sizeof "--strip-trailing-cr"
+ sizeof args - 1
- + quote_system_arg (0, filea) + 1
- + quote_system_arg (0, fileb) + 1);
+ + shell_quote_length (filea) + 1
+ + shell_quote_length (fileb) + 1);
char *p = command;
- p += quote_system_arg (p, diff_program);
+ p = shell_quote_copy (p, diff_program);
if (text)
{
strcpy (p, " -a");
@@ -1212,9 +1212,9 @@ read_diff (char const *filea,
}
strcpy (p, args);
p += sizeof args - 1;
- p += quote_system_arg (p, filea);
+ p = shell_quote_copy (p, filea);
*p++ = ' ';
- p += quote_system_arg (p, fileb);
+ p = shell_quote_copy (p, fileb);
*p = 0;
errno = 0;
fpipe = popen (command, "r");