ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Michael Ivanov <ivans@isle.spb.ru>
To: mandrake-russian@altlinux.ru
Subject: Re: [mdk-re] C/C++ question
Date: Thu May  3 20:24:01 2001
Message-ID: <01050312455600.12074@island.home.net> (raw)
In-Reply-To: <20010430205935.56328632@ser-linux.ffyud>

On  1 May 2001 00:59, you wrote:
> On Mon, 30 Apr 2001 21:16:55 +0400
>
> Michael Ivanov <ivans@isle.spb.ru> wrote:
> > On 30 April 2001 14:11, you wrote:
> >
> >  В одной программе на "двухкрестовом" столкнулся со строчкой,
> >
> > > наподобие следующего отрывка:
> > >
> > > char		buf[BUFSIZ];
> > > // ...
> > > if ( buf[0] == '\n' || buf[0] == '<cr>' )
> > >                        ^^^^^^^^^^^^^^^^
> >
> > А это не _один_ символ с кодом '\r'? По крайней мере nedit его
> > отображает именно так.
>
> Да, а я тут, старый дурень, дискуссии о симантике С-подобных
> языков веду:)
>
> Но, если честно, то мне еще непонятнее: В nedit это отображается
> '<cr>', в xemacs -- '^M', а мс его вообще не отображает, и при
> просмотре, и при редактировании просто ''. Как выяснить, какой же
> символ в программе. Я всегда думал, что исходный текст есть
> исходный текст, ascii есть ascii. А тут и я, и компилятор в
> затруднении, и неизвестно, какая тулза из богатого инструментария
> *nix может помочь:(
Нет, это просто исходник кривой. Спецсимволы в C положено задавать
с помощью escape-последовательностей (в вашем случае \r). А тулза
есть, sed называется: "sed -e 's/^M/\\r/'" :-)

P.S.: Только ^M с терминала нужно вводить как неинтерпретируемый
спецсимвол: ctrl+V ctrl+M

-- 
 \   / |			           |
 (OvO) |  Michael Ivanov                   |
 (^^^) |      Voice:   +7 (812) 328-1907   |
  \^/  |      E-mail:  ivans@isle.spb.ru   |
  ^ ^  |                                   |



  parent reply	other threads:[~2001-05-03 20:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-30 14:09 Serge Skorokhodov
2001-04-30 14:28 ` Egor Azanov
2001-04-30 18:27   ` Serge Skorokhodov
2001-04-30 17:51 ` Andrei Gerasimenko
2001-04-30 20:28   ` Serge Skorokhodov
2001-04-30 21:28 ` Michael Ivanov
2001-05-03 12:30   ` Serge Skorokhodov
2001-05-03 14:02     ` Sergey Vlasov
2001-05-03 15:54       ` Re[2]: " Serge Skorokhodov
2001-05-03 19:12         ` Sergey Vlasov
2001-05-04 19:18           ` Serge Skorokhodov
2001-05-04 19:22             ` Sergey Vlasov
2001-05-04 20:30               ` Serge Skorokhodov
2001-05-04 20:38                 ` Sergey Vlasov
2001-05-04 23:37                   ` Serge Skorokhodov
2001-05-03 20:24     ` Michael Ivanov [this message]
2001-05-03 21:22     ` Sergei
2001-05-04  9:50     ` Mikhail Zabaluev

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=01050312455600.12074@island.home.net \
    --to=ivans@isle.spb.ru \
    --cc=mandrake-russian@altlinux.ru \
    /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

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git