subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1295201 - /subversion/trunk/tools/diff/diff.c
Date Wed, 29 Feb 2012 18:19:37 GMT
Author: philip
Date: Wed Feb 29 18:19:37 2012
New Revision: 1295201

URL: http://svn.apache.org/viewvc?rev=1295201&view=rev
Log:
Add -w to diff tool to ignore whitespace.

* tools/diff/diff.c
  (main): Create diff options earlier and set ignore_space_all on -w.

Modified:
    subversion/trunk/tools/diff/diff.c

Modified: subversion/trunk/tools/diff/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/diff/diff.c?rev=1295201&r1=1295200&r2=1295201&view=diff
==============================================================================
--- subversion/trunk/tools/diff/diff.c (original)
+++ subversion/trunk/tools/diff/diff.c Wed Feb 29 18:19:37 2012
@@ -89,6 +89,8 @@ int main(int argc, const char *argv[])
 
   options_array = apr_array_make(pool, 0, sizeof(const char *));
 
+  diff_options = svn_diff_file_options_create(pool);
+
   for (i = 1 ; i < argc ; i++)
     {
       if (!no_more_options && (argv[i][0] == '-'))
@@ -105,6 +107,11 @@ int main(int argc, const char *argv[])
               show_c_function = TRUE;
               continue;
             }
+          if (argv[i][1] == 'w' && !argv[i][2])
+            {
+              diff_options->ignore_space = svn_diff_file_ignore_space_all;
+              continue;
+            }
           APR_ARRAY_PUSH(options_array, const char *) = argv[i];
         }
       else
@@ -127,8 +134,6 @@ int main(int argc, const char *argv[])
       return 2;
     }
 
-  diff_options = svn_diff_file_options_create(pool);
-
   svn_err = svn_diff_file_options_parse(diff_options, options_array, pool);
   if (svn_err)
     {



Mime
View raw message