svn commit: r1933206 - subversion/trunk/subversion/libsvn_wc

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <177678031062.1181827.17975035518116045280@svn03-he-fi>
Author: ivan
Date: Tue Apr 21 14:05:10 2026
New Revision: 1933206

Log:
Resolve compiler warning about potentially uninitialized local variable
in subversion/libsvn_wc/questions.c:compare_and_verify().

There were no real problem in the code. 

* subversion/libsvn_wc/questions.c
  (compare_verify): Initialize EOL_STYLE, EOL_STR, KEYWORDS and SPECIAL
   to NULL values if there is no properties. Calculate NEED_TRANSLATION in
   all cases using svn_subst_translation_required().

Modified:
   subversion/trunk/subversion/libsvn_wc/questions.c

Modified: subversion/trunk/subversion/libsvn_wc/questions.c
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/questions.c	Tue Apr 21 12:45:05 2026	(r1933205)
+++ subversion/trunk/subversion/libsvn_wc/questions.c	Tue Apr 21 14:05:10 2026	(r1933206)
@@ -198,7 +198,7 @@ compare_and_verify(svn_boolean_t *modifi
   svn_subst_eol_style_t eol_style;
   const char *eol_str;
   apr_hash_t *keywords;
-  svn_boolean_t special = FALSE;
+  svn_boolean_t special;
   svn_boolean_t need_translation;
   svn_stream_t *v_stream; /* versioned_file */
   svn_boolean_t same;
@@ -219,13 +219,17 @@ compare_and_verify(svn_boolean_t *modifi
 
       if (eol_style == svn_subst_eol_style_unknown)
         return svn_error_create(SVN_ERR_IO_UNKNOWN_EOL, NULL, NULL);
-
-      need_translation = svn_subst_translation_required(eol_style, eol_str,
-                                                        keywords, special,
-                                                        TRUE);
     }
   else
-    need_translation = FALSE;
+    {
+      eol_style = svn_subst_eol_style_none;
+      eol_str = NULL;
+      keywords = NULL;
+      special = FALSE;
+    }
+
+  need_translation = svn_subst_translation_required(eol_style, eol_str,
+                                                    keywords, special, TRUE);
 
   /* Easy out check: different sizes with no translation mean the
    * file was modified. */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.