Re: [PATCH] git-remote-mediawiki: escape double quotes and LF in file names
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Nov 29, 2012, 16:57 UTC
- Message-ID
- <vpq624omjn4.fsf@grenoble-inp.fr>
- In-Reply-To
- <7vy5hkqsut.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 11 quoted lines
>> +sub fe_escape_path {
>> + my $path = shift;
>> + $path =~ s/"/\\"/g;
>> + $path =~ s/\n/\\n/g;
>> + return $path;
>> +}
>
> Is this sufficient?
>
> My reading of the big comment at the beginning of fast-import.c is
> that you would also want to quote each backslash;Nice catch, thanks.
Also, I was lacking the double-quotes around $path. In my defense, I had only read the doc, not the code, and git-fast-import.txt was less complete than fast-import.c. New patch follows, fixing the doc too.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/