[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] fix for programmer error in path split text logic

From: Martin Furter <mfurter_at_bluewin.ch>
Date: Mon, 09 Dec 2013 16:39:47 +0530

On 12/09/13 15:27, Philip Martin wrote:
> Martin Furter<mfurter_at_bluewin.ch> writes:
>
>> Wouldn't last_dot[1] be more readable than (*(last_dot + 1) ?
>
> Probably. I approve a patch if you want to commit.

A quick grep shows 21 of those constructs in the following files:

./subversion/libsvn_subr/path.c
./subversion/libsvn_subr/dirent_uri.c
./subversion/libsvn_subr/string.c
./subversion/libsvn_ra_svn/marshal.c
./subversion/libsvn_diff/diff_memory.c
./subversion/libsvn_diff/parse-diff.c
./subversion/libsvn_client/patch.c

A grep for "foo[N]" where N is >0 finds more than 900 lines. And lines
containing "char foo[N]" are already subtracted.

I guess we should make all these 21 cases consistent with the rest of
the code.

[[[
Replace 21 occurrences of *(foo+N) by the more readable foo[N] syntax.

* subversion/libsvn_client/patch.c
   (readline_prop): Replace *(foo+N) by foo[N].
* subversion/libsvn_diff/diff_memory.c
   (fill_source_tokens): Ditto.
* subversion/libsvn_diff/parse-diff.c
   (git_start): Ditto.
* subversion/libsvn_ra_svn/marshal.c
   (vwrite_tuple): Ditto.
* subversion/libsvn_subr/dirent_uri.c
   (canonicalize,svn_uri_is_canonical): Ditto.
* subversion/libsvn_subr/path.c
   (svn_path_splitext): Ditto.
* subversion/libsvn_subr/string.c
   (svn_cstring_count_newlines): Ditto.
]]]

Trying to get it to compile and test but Schwurblix always decides to
not install the important packages. I'm working on it...

- Martin

Received on 2013-12-09 12:10:37 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.