Author: kotkov
Date: Thu Mar  4 13:08:58 2021
New Revision: 1887173

URL: http://svn.apache.org/viewvc?rev=1887173&view=rev
Log:
In svn_subst_translation_required(), handle an empty keyword set and avoid
reporting that translation is necessary in that case.

An empty keyword set does not require translation, according to the
svn_subst_stream_translated().  Having the more accurate check should be
useful for certain calling sites, such as diff_local.c:translate_if_necessary(),
where knowing that the translation wouldn't be necessary allows us to skip
creating a temporary file, and etc.

* subversion/libsvn_subr/subst.c
  (svn_subst_translation_required): Require a non-empty keyword set.

Modified:
    subversion/trunk/subversion/libsvn_subr/subst.c

Modified: subversion/trunk/subversion/libsvn_subr/subst.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/subst.c?rev=1887173&r1=1887172&r2=1887173&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/subst.c (original)
+++ subversion/trunk/subversion/libsvn_subr/subst.c Thu Mar  4 13:08:58 2021
@@ -111,7 +111,8 @@ svn_subst_translation_required(svn_subst
                                svn_boolean_t special,
                                svn_boolean_t force_eol_check)
 {
-  return (special || keywords
+  return (special
+          || (keywords && apr_hash_count(keywords) > 0)
           || (style != svn_subst_eol_style_none && force_eol_check)
           || (style == svn_subst_eol_style_native &&
               strcmp(APR_EOL_STR, SVN_SUBST_NATIVE_EOL_STR) != 0)


Reply via email to