You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2013/01/17 22:13:25 UTC

svn commit: r1434917 - /subversion/trunk/subversion/svn/conflict-callbacks.c

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
         {