From: Paolo Bonzini <pbonzini@redhat.com>
To: "Andreas Färber" <andreas.faerber@web.de>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH] win32: Fix CRLF problem in make_device_config.sh
Date: Fri, 17 Dec 2010 22:25:07 +0100 [thread overview]
Message-ID: <4D0BD533.4060902@redhat.com> (raw)
In-Reply-To: <E864DC97-ED54-40CF-A5AE-C3A0961F1F4D@web.de>
On 12/17/2010 10:00 PM, Andreas Färber wrote:
> Am 17.12.2010 um 20:54 schrieb Stefan Weil:
>
>> Am 17.12.2010 20:33, schrieb Andreas Färber:
>>> Am 17.12.2010 um 20:01 schrieb Stefan Weil:
>>>
>>>> Am 17.12.2010 14:44, schrieb Paolo Bonzini:
>>>>> On 12/17/2010 02:34 PM, Andreas Färber wrote:
>>>>>>>>
>>>>>>>> Fix this by removing any \r at end of line.
>>>>>>>
>>>>>>> Why isn't cygwin (or whatever you're using) removing it?
>>>>>>
>>>>>> I believe Cygwin had an option to choose the line ending style once
>>>>>> during setup. By default it uses Unix-style line endings.
>>>>>> If someone edits source files in some Windows editor, the above issue
>>>>>> seems likely.
>>>>>
>>>>> Hmm, MSYS is more problematic: the manual says "In the MSYS
>>>>> environment under Windows, `gawk' automatically uses binary mode
>>>>> for reading and writing files. Thus there is no need to use the
>>>>> `BINMODE' variable. This can cause problems with other Unix-like
>>>>> components that have been ported to Windows that expect `gawk' to
>>>>> do automatic translationof `"\r\n"', since it won't.".
>>>>
>>>> I had the \r problem when using msys. There seem to be several factors:
>>>>
>>>> * git configuration (add CR / don't add CR)
>>>> * msys mount options (binmode / textmode)
>>>> * (g)awk (read binary)
>>>>
>>>>>
>>>>>> My awk foo is insufficient to ack the patch but if it doesn't break
>>>>>> Unices it looks reasonable to me.
>>>>>
>>>>> I'd be worried a bit about Solaris and other proprietary OSes with
>>>>> prehistoric Unix utilities. Perhaps using \012 instead of \r is
>>>>> better.
>>>>>
>>>>> Paolo
>>>>
>>>> I currently have no possibility to run tests with other awk
>>>> implementations,
>>>> so I cannot tell whether \012 is needed at all (\r is not a new
>>>> invention).
>>>> Do all awk versions support regular expressions with characters in
>>>> octal encoding?.
>>>>
>>>> Perhaps we can wait several days for feedback from users with an old
>>>> awk
>>>> and apply the patch if there is none.
>>>
>>> I have an open bug ticket wrt configure being broken on Solaris 10
>>> due to tracing shell incompatibilities.
>>>
>>> If you provide a small self-contained example I can check though.
>>>
>>> Andreas
>>
>>
>> Example (needs bash's echo -e):
>>
>> # create line with crlf ending:
>> echo -e 'include xy\r' >file
>>
>> # returns xy\r:
>> awk '/^include / {ORS=" "; print $2}' file | od
>
> 0000000 074570 020015
> 0000004
>
>> # should return xy:
>> awk '/^include / {ORS=" "; sub(/\r$/, "", $2); print $2}' file | od
>
> awk: syntax error near line 1
> awk: illegal statement near line 1
> 0000000
Can you try \015 instead of \r?
Paolo
next prev parent reply other threads:[~2010-12-17 21:25 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-16 21:52 [Qemu-devel] [PATCH] win32: Fix CRLF problem in make_device_config.sh Stefan Weil
2010-12-16 22:42 ` [Qemu-devel] " Paolo Bonzini
2010-12-17 13:34 ` Andreas Färber
2010-12-17 13:44 ` Paolo Bonzini
2010-12-17 19:01 ` Stefan Weil
2010-12-17 19:33 ` Andreas Färber
2010-12-17 19:54 ` Stefan Weil
2010-12-17 21:00 ` Andreas Färber
2010-12-17 21:25 ` Paolo Bonzini [this message]
2010-12-17 22:17 ` Andreas Färber
2010-12-17 23:24 ` Paolo Bonzini
2010-12-18 10:19 ` Stefan Weil
2010-12-18 12:02 ` Andreas Färber
2010-12-18 14:20 ` Stefan Weil
2010-12-17 20:08 ` Paolo Bonzini
2010-12-18 16:34 ` [Qemu-devel] [PATCH v2] " Stefan Weil
2010-12-18 17:09 ` Andreas Färber
2010-12-18 18:59 ` Blue Swirl
2010-12-19 15:42 ` Stefan Weil
2010-12-19 16:06 ` Andreas Färber
2010-12-20 10:37 ` Paolo Bonzini
2010-12-30 21:53 ` Andreas Färber
2010-12-30 22:04 ` [Qemu-devel] [PATCH] make_device_config: Fix non-fatal error message with dash and other shells Stefan Weil
2010-12-30 23:08 ` Andreas Färber
2010-12-19 16:21 ` [Qemu-devel] [PATCH v2] win32: Fix CRLF problem in make_device_config.sh Blue Swirl
2010-12-19 16:43 ` Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D0BD533.4060902@redhat.com \
--to=pbonzini@redhat.com \
--cc=andreas.faerber@web.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).