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

[PATCH] svnadmin load will not import dump with windows newline character in svn:mergeinfo

From: John Skopis <jskopis_at_backstopsolutions.com>
Date: Fri, 8 May 2009 15:34:43 -0500

Hello,

svnadmin load fails while importing a dump that contains a windows newline in svn:mergeinfo prop. I have not done extensive testing on this patch, but it should work (in that it doesn't segfault when I attempt to import a revision with \r\n in mergeinfo). Be advised I am not actually a developer.

Thanks,
John Skopis
Systems Administration

[[[
* subversion/libsvn_subr/mergeinfo.c
 (parse_revlist): Ignore windows newlines in svn:mergeinfo
]]]

Index: subversion/libsvn_subr/mergeinfo.c
===================================================================
--- subversion/libsvn_subr/mergeinfo.c (revision 37647)
+++ subversion/libsvn_subr/mergeinfo.c (working copy)
@@ -402,7 +403,7 @@
       svn_revnum_t firstrev;
 
       SVN_ERR(svn_revnum_parse(&firstrev, curr, &curr));
- if (*curr != '-' && *curr != '\n' && *curr != ',' && *curr != '*'
+ if (*curr != '-' && *curr != '\n' && *curr != ',' && *curr != '*' && *curr != '\r'
           && curr != end)
         return svn_error_createf(SVN_ERR_MERGEINFO_PARSE_ERROR, NULL,
                                  _("Invalid character '%c' found in revision "
@@ -430,8 +431,10 @@
           mrange->end = secondrev;
         }
 
- if (*curr == '\n' || curr == end)
+ if (*curr == '\r' || *curr == '\n' || curr == end)
         {
+ if ( *curr == '\r' )
+ curr++;
           APR_ARRAY_PUSH(revlist, svn_merge_range_t *) = mrange;
           *input = curr;
           return SVN_NO_ERROR;
@@ -445,10 +448,10 @@
         {
           mrange->inheritable = FALSE;
           curr++;
- if (*curr == ',' || *curr == '\n' || curr == end)
+ if (*curr == ',' || *curr == '\n' || *curr == '\r' || curr == end )
             {
               APR_ARRAY_PUSH(revlist, svn_merge_range_t *) = mrange;
- if (*curr == ',')
+ if (*curr == ',' || *curr == '\r' )
                 {
                   curr++;
                 }

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2121222
Received on 2009-05-09 00:23:26 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.