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

Re: svn commit: r33148 - in trunk/subversion: include include/private libsvn_fs libsvn_subr

From: Greg Stein <gstein_at_gmail.com>
Date: Wed, 17 Sep 2008 14:52:11 -0700

On Wed, Sep 17, 2008 at 2:41 PM, <danielsh_at_tigris.org> wrote:
>...
> +++ trunk/subversion/libsvn_subr/path.c Wed Sep 17 14:41:28 2008 (r33148)
> @@ -842,6 +842,26 @@ svn_path_is_single_path_component(const
>
>
> svn_boolean_t
> +svn_path_is_dotpath_present(const char *path)
> +{
> + int len = strlen(path);
> +
> + if (! strcmp(path, "."))
> + return TRUE;
> +
> + if (! strncmp(path, "./", 2))
> + return TRUE;
> +
> + if (strstr(path, "/./") != NULL)
> + return TRUE;
> +
> + if (path[len - 2] == '/' && path[len - 1] == '.')
> + return TRUE;

if len==1, then the above statement will choke. i.e. pass "a"

I'd suggest changing the first two tests to something like:

if (len == 1)
  {
    return path[0] == '.';
  }
if (path[0] == '.' && path[1] == '/')
  return TRUE;
... rest of function

Cheers,
-g

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-09-17 23:52:27 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.