From owner-freebsd-current Sat Jan 10 08:12:45 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id IAA13622 for current-outgoing; Sat, 10 Jan 1998 08:12:45 -0800 (PST) (envelope-from owner-freebsd-current) Received: from lsd.relcom.eu.net (ache@lsd.relcom.eu.net [193.124.23.23]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id IAA13526; Sat, 10 Jan 1998 08:11:51 -0800 (PST) (envelope-from ache@lsd.relcom.eu.net) Received: (from ache@localhost) by lsd.relcom.eu.net (8.8.8/8.8.8) id TAA27793; Sat, 10 Jan 1998 19:11:33 +0300 (MSK) (envelope-from ache) Date: Sat, 10 Jan 1998 19:11:31 +0300 (MSK) From: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= X-Sender: ache@lsd.relcom.eu.net To: Mike Smith cc: FreeBSD-current , Joerg Wunsch , peter@FreeBSD.ORG Subject: CVS DIFF fix for review (-L added) In-Reply-To: <199801071350.AAA01279@word.smith.net.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Since Index: is dead for context diffs, here is a patch to correct ***/--- pathnames generated by CVS (now using -L diff option like in rcsdiff). Since I not run CVS and don't know how to do its minimal setup, please test and check is it really fix the problem. I plan commit it after feedback from you. *** src/diff.c.orig Sat May 24 23:48:15 1997 --- src/diff.c Sat Jan 10 18:53:13 1998 *************** *** 169,174 **** --- 169,185 ---- strcat (*str, src); } + static char *set_diff_label PROTO ((const char *fname)); + + static char *set_diff_label(fname) + const char *fname; + { + static char label[FILENAME_MAX + 3]; + + (void)snprintf(label, sizeof(label), "-L%s", fname); + return label; + } + int diff (argc, argv) int argc; *************** *** 567,574 **** if (empty_file == DIFF_ADDED) { if (use_rev2 == NULL) ! run_setup ("%s %s %s %s", DIFF, opts, DEVNULL, finfo->file); else { int retcode; --- 578,587 ---- if (empty_file == DIFF_ADDED) { + char *fn; + if (use_rev2 == NULL) ! fn = finfo->file; else { int retcode; *************** *** 589,596 **** } /* FIXME: what if retcode > 0? */ ! run_setup ("%s %s %s %s", DIFF, opts, DEVNULL, tmp); } } else { --- 602,614 ---- } /* FIXME: what if retcode > 0? */ ! fn = tmp; } + run_setup ("%s %s", DIFF, opts); + run_arg (set_diff_label (DEVNULL)); + run_arg (set_diff_label (finfo->fullname)); + run_arg (DEVNULL); + run_arg (fn); } else { *************** *** 610,616 **** } /* FIXME: what if retcode > 0? */ ! run_setup ("%s %s %s %s", DIFF, opts, tmp, DEVNULL); } } else --- 628,637 ---- } /* FIXME: what if retcode > 0? */ ! run_setup ("%s %s", DIFF, opts); ! run_arg (set_diff_label (finfo->fullname)); ! run_arg (tmp); ! run_arg (DEVNULL); } } else *************** *** 626,631 **** --- 647,653 ---- run_setup ("%s%s -x,v/ %s %s -r%s", Rcsbin, RCS_DIFF, opts, *options ? options : vers->options, use_rev1); } + run_arg (set_diff_label (finfo->fullname)); run_arg (vers->srcfile->path); } -- Andrey A. Chernov http://www.nagual.pp.ru/~ache/