[PATCH db/vcs-svn-incremental] vcs-svn: quote all paths passed to fast-import
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 11, 2010, 23:11 UTC
- Message-ID
- <20101211231123.GA31179@burratino>
- In-Reply-To
- <DD24C01C-19FD-424B-B602-E9BB1A930805@cordelta.com>
Filenames with linefeeds or double quotes need to be quoted if fast-import is not to misinterpret them.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> --- vcs-svn/fast_export.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c index 7856ff2..2d2a6b2 100644 --- a/vcs-svn/fast_export.c +++ b/vcs-svn/fast_export.c @@ -31,19 +31,18 @@ static int init_postimage(void) void fast_export_delete(uint32_t depth, const uint32_t *path) { - putchar('D'); - putchar(' '); - pool_print_seq(depth, path, '/', stdout); - putchar('\n'); + printf("D \""); + pool_print_seq_q(depth, path, '/', stdout); + printf("\"\n"); } void fast_export_modify(uint32_t depth, const uint32_t *path, uint32_t mode, const char *dataref) { /* Mode must be 100644, 100755, 120000, or 160000. */ - printf("M %06"PRIo32" %s ", mode, dataref); - pool_print_seq(depth, path, '/', stdout); - putchar('\n'); + printf("M %06"PRIo32" %s \"", mode, dataref); + pool_print_seq_q(depth, path, '/', stdout); + printf("\"\n"); } static char gitsvnline[MAX_GITSVN_LINE_LEN];
-- 1.7.2.4