delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/07/15/20:05:25

From: Eric Backus <ericb AT lsid DOT hp DOT com>
Subject: Re: patch for doscan.c
To: buers AT dg1 DOT chemie DOT uni-konstanz DOT de (Dieter Buerssner) (Dieter Buerssner)
Date: Wed, 15 Jul 92 16:05:29 PDT
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Mailer: Elm [revision: 66.25]

> When you open a file in binary mode, fscanf does not work correctly.
> It doesn't consider '\r' as whitespace, so it fails on files with
> the usal MSDOS "\r\n" end of line. The following patch should help.
> If you want to try it, please let me know, whether it worked or not.

According to the ANSI C definition of fscanf(), "white space" in the
input stream consists of any combination of: space, tab, newline,
vertical tab, formfeed, and carriage return.  Those are ASCII
characters 0x20, 0x09, 0x0a, 0x0b, 0x0c, and 0x0d.

So, it appears that we still need to add cases for vertical tab ('\v')
and formfeed ('\f').
--
				Eric Backus
				ericb%hplsla AT hplabs DOT hp DOT com
				(206) 335-2495

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019