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

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <177678504847.1207392.9954016973184832577@svn03-he-fi>
Author: ivan
Date: Tue Apr 21 15:24:08 2026
New Revision: 1933210

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

There were no real problem in the code. 

Similar to r1933206.

* subversion/libsvn_wc/textbase.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/textbase.c

Modified: subversion/trunk/subversion/libsvn_wc/textbase.c
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/textbase.c	Tue Apr 21 15:08:14 2026	(r1933209)
+++ subversion/trunk/subversion/libsvn_wc/textbase.c	Tue Apr 21 15:24:08 2026	(r1933210)
@@ -42,7 +42,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_checksum_t *v_checksum;
@@ -64,12 +64,18 @@ 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);
 
   if (! need_translation)
     {
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.