From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55686 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PThnR-0004Od-KJ for qemu-devel@nongnu.org; Fri, 17 Dec 2010 16:25:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PThnP-0002eH-PN for qemu-devel@nongnu.org; Fri, 17 Dec 2010 16:25:01 -0500 Received: from mail-bw0-f45.google.com ([209.85.214.45]:40541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PThnP-0002dw-IN for qemu-devel@nongnu.org; Fri, 17 Dec 2010 16:24:59 -0500 Received: by bwz16 with SMTP id 16so1469093bwz.4 for ; Fri, 17 Dec 2010 13:24:58 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4D0BD533.4060902@redhat.com> Date: Fri, 17 Dec 2010 22:25:07 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1292536325-12881-1-git-send-email-weil@mail.berlios.de> <4D0A95BC.8040509@redhat.com> <4D0B6922.3090401@redhat.com> <4D0BB3A1.30001@mail.berlios.de> <7DDF4A15-DEEC-422A-94C7-8ED20B6DAA92@web.de> <4D0BC00B.3040800@mail.berlios.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] Re: [PATCH] win32: Fix CRLF problem in make_device_config.sh List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: QEMU Developers 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