subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1434917 - /subversion/trunk/subversion/svn/conflict-callbacks.c
Date Thu, 17 Jan 2013 21:13:25 GMT
Author: julianfoad
Date: Thu Jan 17 21:13:24 2013
New Revision: 1434917

URL: http://svn.apache.org/viewvc?rev=1434917&view=rev
Log:
Fix an interactive conflict resolution buglet (just displaying an extra
option in one case) and a coding style issue.  A follow-up to r1416578.

* subversion/svn/conflict-callbacks.c
  (ARRAY_LEN): New macro.
  (handle_text_conflict): Use it instead of a
    magic number. Omit not only 'mc' but also 'tc' for a binary file.

Modified:
    subversion/trunk/subversion/svn/conflict-callbacks.c

Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1434917&r1=1434916&r2=1434917&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Thu Jan 17 21:13:24 2013
@@ -42,6 +42,8 @@
 
 #include "svn_private_config.h"
 
+#define ARRAY_LEN(ary) ((sizeof (ary)) / (sizeof ((ary)[0])))
+
 
 
 struct svn_cl__interactive_conflict_baton_t {
@@ -474,7 +476,7 @@ handle_text_conflict(svn_wc_conflict_res
 
   while (TRUE)
     {
-      const char *options[12];  /* size of array must be big enough */
+      const char *options[ARRAY_LEN(text_conflict_options)];
       const char **next_option = options;
       const char *prompt;
       const char *answer;
@@ -492,8 +494,10 @@ handle_text_conflict(svn_wc_conflict_res
             *next_option++ = "r";
 
           if (! desc->is_binary)
-            *next_option++ = "mc";
-            *next_option++ = "tc";
+            {
+              *next_option++ = "mc";
+              *next_option++ = "tc";
+            }
         }
       else
         {



Mime
View raw message