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

Bug in subversion?

From: Robert Bocheński <r.bochenski_at_home.pl>
Date: 2006-01-26 10:43:23 CET

Hi,

I have a problem with subversion. When I'm trying to commit files placed in different folders and
one of the file is in top level folder subversion gives an error: 'abort trap...'

I realized that with this to avoid infinite loop in file
  './subversion/libsvn_client/commit.c'

Problem is in this code (line ~ 1300 in version 1.3.0)

           while (strcmp (target, base_dir))
             {
               if (target[0] == '/' && target[1] == '\0') {
                 abort();
               }

               APR_ARRAY_PUSH (dirs_to_lock,
                               const char *) = apr_pstrdup (pool, target);
               target = svn_path_dirname(target, subpool);

             }

I think this solution isn't very good.
This is what i've done but i know that is still not very goo solution:

*** subversion-1.3.0/subversion/libsvn_client/commit.c Wed Jan 25 11:41:49 2006
--- commit.c Thu Jan 26 10:36:35 2006
***************
*** 1222,1230 ****
     if (! base_dir)
       return SVN_NO_ERROR;

- if (!*base_dir)
- *(char*)base_dir = '/';
-
     /* Prepare an array to accumulate dirs to lock */
     dirs_to_lock = apr_array_make (pool, 1, sizeof (target));
     dirs_to_lock_recursive = apr_array_make (pool, 1, sizeof (target));
--- 1222,1227 ----
***************
*** 1312,1328 ****
               }

             target = parent_dir;
-
             while (strcmp (target, base_dir))
               {
! /* if (target[0] == '/' && target[1] == '\0') {
                   abort();
! }
! */
                 APR_ARRAY_PUSH (dirs_to_lock,
                                 const char *) = apr_pstrdup (pool, target);
                 target = svn_path_dirname(target, subpool);
-
               }
           }
         svn_pool_destroy (subpool);
--- 1309,1322 ----
               }

             target = parent_dir;
             while (strcmp (target, base_dir))
               {
! if (target[0] == '/' && target[1] == '\0')
                   abort();
!
                 APR_ARRAY_PUSH (dirs_to_lock,
                                 const char *) = apr_pstrdup (pool, target);
                 target = svn_path_dirname(target, subpool);
               }
           }
         svn_pool_destroy (subpool);

Right solution should be done somewhere deeper in path functions.

-- 
Best Regards
Robert Bochenski
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jan 26 10:45:03 2006

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

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