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

Re: subversion/libsvn_subr/path.c:1259: possible bad if ?

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Fri, 8 May 2015 08:48:48 +0100

David Binderman wrote:
> [subversion/libsvn_subr/path.c:1259]: (warning) Char literal compared with pointer 'last_dot'. Did you intend to dereference it?
>
> if (last_dot && (last_dot + 1 != '\0'))

Thanks for the report. However, this has already been fixed in trunk:

http://svn.apache.org/viewvc?revision=1548480&view=revision

r1548480 | philip | 2013-12-06 10:01:17 +0000 (Fri, 06 Dec 2013) | 11 lines

* subversion/libsvn_subr/path.c
  (svn_path_splitext): Fixed correct pointer comparison to NULL to check
  for end of string, instead of checking if the character itself was NULL.
  The only output change is that a pool allocated "" is now a static "".

* subversion/tests/libsvn_subr/path-test.c
  (test_path_splitext): New case.

Patch by: eric{_AT_}lubin.us
          me

According to that log message, the only difference it makes is a small
difference in memory allocation. In that case, there wouldn't be much
reason to back-port it to released versions.

Regards,
- Julian
Received on 2015-05-08 09:49:30 CEST

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.