[Gimp-docs] diff/patch problems
Ulf-D. Ehlert
ude88 at web.de
Wed Oct 10 13:57:46 PDT 2007
Hi,
Kolbjørn Stuestøl (Mittwoch, 10. Oktober 2007, 21:34):
> Added my translations
Did you use a Windows editor?
I'm pretty sure that after editing every line of the file contained a
trailing "Carriage Return" character (CR aka \r aka ^M).
> Looking at for example the file drop-shadow.xml in the test.patch the
> only "normal" lines are the two first:
>
> --- src/filters/light_effects/drop-shadow.xml (revision 2107)
>
> +++ src/filters/light_effects/drop-shadow.xml (working copy)
>
> The next lines are marked for deletion with a minus sign (-):
>
> @@ -1,575 +1,581 @@
>
> -<?xml version="1.0" encoding="UTF-8"?>
>
> -
>
> .
>
> - </sect3>
>
> -</sect2>
>
>
>
> Thereafter all lines, including my adding's, are signed with a plus
> sign indicating this lines should be added:
>
> +<?xml version="1.0" encoding="UTF-8"?>
>
> +
>
> +<!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
>
> + "http://www.docbook.org/xml/4.3/docbookx.dtd">
The lines differ due to the invisible CR char.
> > Hmm, trailing "^M"s in your modified files?! Try "cat -v
> > file-name".
>
> No help, just added lots of "^M"s to the file.
Yes! "cat -v" or "cat --show-nonprinting" should just show you if there
were trailing CR chars.
Example:
[ulf at linux] cat -v file-without-CR
foo
bar
[ulf at linux] recode lat1..ibmpc file-without-CR
[ulf at linux] cat -v file-without-CR
foo^M
bar^M
[ulf at linux] recode ibmpc..lat1 file-without-CR
[ulf at linux] cat -v file-without-CR
foo
bar
So you just have to remove these characters. Maybe there's an editor
option to do this automatically? (BTW, did you change/update your
editor?)
Otherwise, you can try:
tr -d '\r' < input_file_with_CR > output_file_without_CR
or
perl -i -p -e 's/\r$//' file_with_CR
or
sed -e 's/\r//' input_file_with_CR > output_file_without_CR
or
recode ibmpc..utf8 file_with_CR
after editing your files. (Check with "cat -v".)
HTH
Bye,
Ulf
More information about the Gimp-docs
mailing list