Index: src/patch.c =================================================================== RCS file: /cvsroot/src/external/gpl2/xcvs/dist/src/patch.c,v retrieving revision 1.3 diff -p -r1.3 patch.c *** src/patch.c 10 Apr 2009 11:20:30 -0000 1.3 --- src/patch.c 24 Sep 2011 11:34:01 -0000 *************** static char *tmpfile1 = NULL; *** 43,58 **** static char *tmpfile2 = NULL; static char *tmpfile3 = NULL; static int unidiff = 0; static const char *const patch_usage[] = { ! "Usage: %s %s [-flR] [-c|-u] [-s|-t] [-V %%d] [-k kopt]\n", " -r rev|-D date [-r rev2 | -D date2] modules...\n", "\t-f\tForce a head revision match if tag/date not found.\n", "\t-l\tLocal directory only, not recursive\n", "\t-R\tProcess directories recursively.\n", "\t-c\tContext diffs (default)\n", "\t-u\tUnidiff format.\n", "\t-s\tShort patch - one liner per file.\n", "\t-t\tTop two diffs - last change made to the file.\n", "\t-V vers\tUse RCS Version \"vers\" for keyword expansion.\n", --- 43,60 ---- static char *tmpfile2 = NULL; static char *tmpfile3 = NULL; static int unidiff = 0; + static int show_c_func = 0; static const char *const patch_usage[] = { ! "Usage: %s %s [-flR] [-p] [-c|-u] [-s|-t] [-V %%d] [-k kopt]\n", " -r rev|-D date [-r rev2 | -D date2] modules...\n", "\t-f\tForce a head revision match if tag/date not found.\n", "\t-l\tLocal directory only, not recursive\n", "\t-R\tProcess directories recursively.\n", "\t-c\tContext diffs (default)\n", "\t-u\tUnidiff format.\n", + "\t-p\tShow which C function each change is in.\n", /* --show-c-function */ "\t-s\tShort patch - one liner per file.\n", "\t-t\tTop two diffs - last change made to the file.\n", "\t-V vers\tUse RCS Version \"vers\" for keyword expansion.\n", *************** patch (int argc, char **argv) *** 78,84 **** usage (patch_usage); getoptreset (); ! while ((c = getopt (argc, argv, "+V:k:cuftsQqlRD:r:")) != -1) { switch (c) { --- 80,86 ---- usage (patch_usage); getoptreset (); ! while ((c = getopt (argc, argv, "+V:k:cuftsQqlRD:r:p")) != -1) { switch (c) { *************** patch (int argc, char **argv) *** 154,159 **** --- 156,164 ---- case 'c': /* Context diff */ unidiff = 0; break; + case 'p': + show_c_func = 1; + break; case '?': default: usage (patch_usage); *************** patch (int argc, char **argv) *** 202,207 **** --- 207,214 ---- send_arg("-s"); if (unidiff) send_arg("-u"); + if (show_c_func) + send_arg("-p"); if (rev1) option_with_arg ("-r", rev1); *************** patch_fileproc (void *callerdat, struct *** 571,576 **** --- 578,585 ---- if (unidiff) run_add_arg_p (&dargc, &darg_allocated, &dargv, "-u"); else run_add_arg_p (&dargc, &darg_allocated, &dargv, "-c"); + if (show_c_func) + run_add_arg_p (&dargc, &darg_allocated, &dargv, "-p"); switch (diff_exec (tmpfile1, tmpfile2, NULL, NULL, dargc, dargv, tmpfile3)) {