Skip to content

Commit 2c83051

Browse files
author
Ivan Zhakov
committed
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(). git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1933210 13f79535-47bb-0310-9956-ffa450edef68
1 parent a24359b commit 2c83051

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

subversion/libsvn_wc/textbase.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ compare_and_verify(svn_boolean_t *modified_p,
4242
svn_subst_eol_style_t eol_style;
4343
const char *eol_str;
4444
apr_hash_t *keywords;
45-
svn_boolean_t special = FALSE;
45+
svn_boolean_t special;
4646
svn_boolean_t need_translation;
4747
svn_stream_t *v_stream; /* versioned_file */
4848
svn_checksum_t *v_checksum;
@@ -64,12 +64,18 @@ compare_and_verify(svn_boolean_t *modified_p,
6464
if (eol_style == svn_subst_eol_style_unknown)
6565
return svn_error_create(SVN_ERR_IO_UNKNOWN_EOL, NULL, NULL);
6666

67-
need_translation = svn_subst_translation_required(eol_style, eol_str,
68-
keywords, special,
69-
TRUE);
7067
}
7168
else
72-
need_translation = FALSE;
69+
{
70+
eol_style = svn_subst_eol_style_none;
71+
eol_str = NULL;
72+
keywords = NULL;
73+
special = FALSE;
74+
}
75+
76+
need_translation = svn_subst_translation_required(eol_style, eol_str,
77+
keywords, special,
78+
TRUE);
7379

7480
if (! need_translation)
7581
{

0 commit comments

Comments
 (0)