subversion-1.11.1/subversion/libsvn_client/upgrade.c:353: poor error checking ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

subversion-1.11.1/subversion/libsvn_client/upgrade.c:353: poor error checking ?

David Binderman
Hello there,

subversion-1.11.1/subversion/libsvn_client/upgrade.c:353] -> [subversion-1.11.1/subversion/libsvn_client/upgrade.c:358]: (style) The if condition is the same as the previous if condition

Source code is

      if (!err)
        externals_parent_url = svn_path_url_add_component2(
                                    externals_parent_repos_root_url,
                                    externals_parent_repos_relpath,
                                    iterpool);
      if (!err)

Maybe better code

      if (!err)
        externals_parent_url = svn_path_url_add_component2(
                                    externals_parent_repos_root_url,
                                    externals_parent_repos_relpath,
                                    iterpool);

      if (externals_parent_url)

Regards

David Binderman

Reply | Threaded
Open this post in threaded view
|

Re: subversion-1.11.1/subversion/libsvn_client/upgrade.c:353: poor error checking ?

Branko Čibej
On 12.01.2019 16:32, David Binderman wrote:

> Hello there,
>
> subversion-1.11.1/subversion/libsvn_client/upgrade.c:353] -> [subversion-1.11.1/subversion/libsvn_client/upgrade.c:358]: (style) The if condition is the same as the previous if condition
>
> Source code is
>
>       if (!err)
>         externals_parent_url = svn_path_url_add_component2(
>                                     externals_parent_repos_root_url,
>                                     externals_parent_repos_relpath,
>                                     iterpool);
>       if (!err)


Thanks! Fixed on trunk in r1851180.


> Maybe better code
>
>       if (!err)
>         externals_parent_url = svn_path_url_add_component2(
>                                     externals_parent_repos_root_url,
>                                     externals_parent_repos_relpath,
>                                     iterpool);
>
>       if (externals_parent_url)


Looks better but is unfortunately wrong. :)

-- Brane