From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7612 invoked by alias); 12 Feb 2002 12:30:30 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 6371 invoked from network); 12 Feb 2002 12:28:25 -0000 Received: from unknown (HELO anchor-post-33.mail.demon.net) (194.217.242.91) by sources.redhat.com with SMTP; 12 Feb 2002 12:28:25 -0000 Received: from mailgate.softwire.co.uk ([62.49.203.138] helo=polarbear) by anchor-post-33.mail.demon.net with esmtp (Exim 3.34 #1) id 16ac27-000BZn-0X; Tue, 12 Feb 2002 12:27:39 +0000 From: "Rupert Wood" To: Cc: Subject: RE: Control M ???? Date: Tue, 12 Feb 2002 05:14:00 -0000 Message-ID: <616BE6A276E3714788D2AC35C40CD18D03AA30@whale.softwire.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-Reply-To: <616BE6A276E3714788D2AC35C40CD18D3F2CB8@whale.softwire.co.uk> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-SW-Source: 2002-02/txt/msg00118.txt.bz2 Kabir Patel wrote: > Some time back I mentioned a problem I had with the ^M character > (see below). It so happens that I need to be able to replace every > ^M in my resultant file with a " " charachter. GNU isn't happy with > ^M. Is there a way to define ^M in another way? Yes, this is exactly the problem you had before. ^M is ASCII 13, representing carriage return (CR); hence you could replace the single character constant '^M' with any of the following: 13 '\x0d' (backslash x zero d: 0d is hexadecimal for 13) '\r' (or the octal string escape represntation, or hex or octal immediates, etc.) The last is a special C-escape for CR and perhaps the most useful representation since it describes the intended meaning here. (On the other hand, this might not be appropriate if you're specifically dealing with PC text files guaranteed to be 13-10 and the host system's CR might not be 13 or something - I guess it's a style call.) If you have ^M in the middle of a string then you should replace it with a string constant escape such the latter two, \x0d or \r. Rup.