Bert Huijben wrote on Thu, Mar 08, 2012 at 10:38:16 +0100: > > > > -----Original Message----- > > From: svn-r...@apache.org [mailto:svn-r...@apache.org] > > Sent: donderdag 8 maart 2012 5:01 > > To: comm...@subversion.apache.org > > Subject: svn commit: r1298264 - in /subversion/branches/1.7.x: ./ STATUS > > subversion/libsvn_wc/props.c > > > > Author: svn-role > > Date: Thu Mar 8 04:01:23 2012 > > New Revision: 1298264 > > > > > Modified: subversion/branches/1.7.x/subversion/libsvn_wc/props.c > > URL: > > http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_wc > > /props.c?rev=1298264&r1=1298263&r2=1298264&view=diff > > ============================================================= > > ================= > > --- subversion/branches/1.7.x/subversion/libsvn_wc/props.c (original) > > +++ subversion/branches/1.7.x/subversion/libsvn_wc/props.c Thu Mar 8 > > 04:01:23 2012 > > @@ -2537,7 +2537,8 @@ svn_wc_canonicalize_svn_prop(const svn_s > > || strcmp(propname, SVN_PROP_EXTERNALS) == 0) > > { > > /* Make sure that the last line ends in a newline */ > > - if (propval->data[propval->len - 1] != '\n') > > + if (propval->len == 0 > > + || propval->data[propval->len - 1] != '\n') > > { > > new_value = svn_stringbuf_create_from_string(propval, pool); > > svn_stringbuf_appendbyte(new_value, '\n'); > > Looking at this patch again at a better hour: > > Why do we add a '\n' to a 0-byte property value. > > I think it should be 'propval->len > 0 && ...' > > Bert >
I assume the preexisting code appended a newline byte to empty property values (though perhaps unintentionally), and the new code preserves this behaviour. I don't know if ("", 0) v. ("\n", 1) makes a difference to the rest of the code.