vcs-svn: quote paths correctly for ls command

This bug was found while importing rev 601865 of ASF.

[jn: with test]

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
This commit is contained in:
David Barr
2010-12-12 03:59:31 +11:00
committed by Jonathan Nieder
parent 723b7a2789
commit e435811208
4 changed files with 112 additions and 1 deletions

View File

@ -4,6 +4,7 @@
*/
#include "git-compat-util.h"
#include "quote.h"
#include "trp.h"
#include "obj_pool.h"
#include "string_pool.h"
@ -75,6 +76,16 @@ void pool_print_seq(uint32_t len, const uint32_t *seq, char delim, FILE *stream)
}
}
void pool_print_seq_q(uint32_t len, const uint32_t *seq, char delim, FILE *stream)
{
uint32_t i;
for (i = 0; i < len && ~seq[i]; i++) {
quote_c_style(pool_fetch(seq[i]), NULL, stream, 1);
if (i < len - 1 && ~seq[i + 1])
fputc(delim, stream);
}
}
uint32_t pool_tok_seq(uint32_t sz, uint32_t *seq, const char *delim, char *str)
{
char *context = NULL;