Source: diffutils
Version: 1:3.0-1
Severity: normal
Tags: patch
Files: src/diff.c man/diff.1

  It seems to me that
    diff -show-c-function
is showing correct results for many programming languages.  
Therefor, I think the following patches should be considered:

--- a/src/diff.c  2010-04-15 22:53:08.000000000 +0300
+++ b/src/diff.c  2011-08-19 20:42:57.000000000 +0300
@@ -195,7 +195,7 @@ static struct option const longopts[] =
   {"recursive", 0, 0, 'r'},
   {"report-identical-files", 0, 0, 's'},
   {"sdiff-merge-assist", 0, 0, SDIFF_MERGE_ASSIST_OPTION},
-  {"show-c-function", 0, 0, 'p'},
+  {"show-enclosing-function", 0, 0, 'p'},
   {"show-function-line", 1, 0, 'F'},
   {"side-by-side", 0, 0, 'y'},
   {"speed-large-files", 0, 0, 'H'},
@@ -265,7 +265,7 @@ main (int argc, char **argv)
   lin ocontext = -1;
   bool explicit_context = false;
   size_t width = 0;
-  bool show_c_function = false;
+  bool show_enclosing_function = false;
   char const *from_file = NULL;
   char const *to_file = NULL;
   uintmax_t numval;
@@ -440,7 +440,7 @@ main (int argc, char **argv)
          break;

        case 'p':
-         show_c_function = true;
+         show_enclosing_function = true;
          add_regexp (&function_regexp_list, "^[[:alpha:]$_]");
          break;

@@ -623,7 +623,7 @@ main (int argc, char **argv)

   if (output_style == OUTPUT_UNSPECIFIED)
     {
-      if (show_c_function)
+      if (show_enclosing_function)
        {
          specify_style (OUTPUT_CONTEXT);
          if (ocontext < 0)
@@ -860,7 +860,7 @@ static char const * const option_help_ms
   N_("-c  -C NUM  --context[=NUM]  Output NUM (default 3) lines of copied co
ntext.\n\
 -u  -U NUM  --unified[=NUM]  Output NUM (default 3) lines of unified context
.\n\
   --label LABEL  Use LABEL instead of file name.\n\
-  -p  --show-c-function  Show which C function each change is in.\n\
+  -p  --show-enclosing-function  Show which source code function each change
 is in.\n\
   -F RE  --show-function-line=RE  Show the most recent line matching RE."),
   N_("-q  --brief  Output only whether files differ."),
   N_("-e  --ed  Output an ed script."),


--- a/man/diff.1  2010-04-15 22:53:19.000000000 +0300
+++ b/man/diff.1  2011-08-19 20:34:30.000000000 +0300
@@ -47,8 +47,8 @@ Output NUM (default 3) lines of unified
 \fB\-\-label\fR LABEL
 Use LABEL instead of file name.
 .TP
-\fB\-p\fR  \fB\-\-show\-c\-function\fR
-Show which C function each change is in.
+\fB\-p\fR  \fB\-\-show\-enclosing\-function\fR
+Show which source code function each change is in.
 .TP
 \fB\-F\fR RE  \fB\-\-show\-function\-line\fR=\fIRE\fR
 Show the most recent line matching RE.




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to