mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
c.lib 1.182 (8.11.2004)
- Changed the error abort condition for the %s conversion of the scanf() family. It now matches the abort conditions for all other conversions and no longer ignores whether any other parameters were converted before. This was a quirk in the older implementation. - The scanf() family now accepts %E and %G in place of %f and %X in place of %x. - Simplified the common code that fopen(), freopen() and fdopen() share and which has to figure out by looking at a file access mode specification which parameters should be used. - Dropped error detection in the scanf() family. The EOF has to be good enough. Also, ungetc() failure still leads to error handling. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14765 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 181
|
||||
#define DATE "26.10.2004"
|
||||
#define VERS "amiga.lib 1.181"
|
||||
#define VSTRING "amiga.lib 1.181 (26.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: amiga.lib 1.181 (26.10.2004)"
|
||||
#define REVISION 182
|
||||
#define DATE "8.11.2004"
|
||||
#define VERS "amiga.lib 1.182"
|
||||
#define VSTRING "amiga.lib 1.182 (8.11.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: amiga.lib 1.182 (8.11.2004)"
|
||||
|
||||
@ -1 +1 @@
|
||||
181
|
||||
182
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 181
|
||||
#define DATE "26.10.2004"
|
||||
#define VERS "c.lib 1.181"
|
||||
#define VSTRING "c.lib 1.181 (26.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: c.lib 1.181 (26.10.2004)"
|
||||
#define REVISION 182
|
||||
#define DATE "8.11.2004"
|
||||
#define VERS "c.lib 1.182"
|
||||
#define VSTRING "c.lib 1.182 (8.11.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: c.lib 1.182 (8.11.2004)"
|
||||
|
||||
@ -1 +1 @@
|
||||
181
|
||||
182
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
c.lib 1.182 (8.11.2004)
|
||||
|
||||
- Changed the error abort condition for the %s conversion of the
|
||||
scanf() family. It now matches the abort conditions for all other
|
||||
conversions and no longer ignores whether any other parameters were
|
||||
@ -10,6 +12,9 @@
|
||||
share and which has to figure out by looking at a file access
|
||||
mode specification which parameters should be used.
|
||||
|
||||
- Dropped error detection in the scanf() family. The EOF has to be
|
||||
good enough. Also, ungetc() failure still leads to error handling.
|
||||
|
||||
|
||||
|
||||
c.lib 1.181 (26.10.2004)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 181
|
||||
#define DATE "26.10.2004"
|
||||
#define VERS "debug.lib 1.181"
|
||||
#define VSTRING "debug.lib 1.181 (26.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: debug.lib 1.181 (26.10.2004)"
|
||||
#define REVISION 182
|
||||
#define DATE "8.11.2004"
|
||||
#define VERS "debug.lib 1.182"
|
||||
#define VSTRING "debug.lib 1.182 (8.11.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: debug.lib 1.182 (8.11.2004)"
|
||||
|
||||
@ -1 +1 @@
|
||||
181
|
||||
182
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 181
|
||||
#define DATE "26.10.2004"
|
||||
#define VERS "m.lib 1.181"
|
||||
#define VSTRING "m.lib 1.181 (26.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: m.lib 1.181 (26.10.2004)"
|
||||
#define REVISION 182
|
||||
#define DATE "8.11.2004"
|
||||
#define VERS "m.lib 1.182"
|
||||
#define VSTRING "m.lib 1.182 (8.11.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: m.lib 1.182 (8.11.2004)"
|
||||
|
||||
@ -1 +1 @@
|
||||
181
|
||||
182
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 181
|
||||
#define DATE "26.10.2004"
|
||||
#define VERS "m881.lib 1.181"
|
||||
#define VSTRING "m881.lib 1.181 (26.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: m881.lib 1.181 (26.10.2004)"
|
||||
#define REVISION 182
|
||||
#define DATE "8.11.2004"
|
||||
#define VERS "m881.lib 1.182"
|
||||
#define VSTRING "m881.lib 1.182 (8.11.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: m881.lib 1.182 (8.11.2004)"
|
||||
|
||||
@ -1 +1 @@
|
||||
181
|
||||
182
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 181
|
||||
#define DATE "26.10.2004"
|
||||
#define VERS "net.lib 1.181"
|
||||
#define VSTRING "net.lib 1.181 (26.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: net.lib 1.181 (26.10.2004)"
|
||||
#define REVISION 182
|
||||
#define DATE "8.11.2004"
|
||||
#define VERS "net.lib 1.182"
|
||||
#define VSTRING "net.lib 1.182 (8.11.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: net.lib 1.182 (8.11.2004)"
|
||||
|
||||
@ -1 +1 @@
|
||||
181
|
||||
182
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 181
|
||||
#define DATE "26.10.2004"
|
||||
#define VERS "stack.lib 1.181"
|
||||
#define VSTRING "stack.lib 1.181 (26.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: stack.lib 1.181 (26.10.2004)"
|
||||
#define REVISION 182
|
||||
#define DATE "8.11.2004"
|
||||
#define VERS "stack.lib 1.182"
|
||||
#define VSTRING "stack.lib 1.182 (8.11.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: stack.lib 1.182 (8.11.2004)"
|
||||
|
||||
@ -1 +1 @@
|
||||
181
|
||||
182
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_vfscanf.c,v 1.5 2004-11-03 15:35:56 obarthel Exp $
|
||||
* $Id: stdio_vfscanf.c,v 1.6 2004-11-08 17:57:52 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -105,24 +105,12 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
|
||||
if(isspace(c))
|
||||
{
|
||||
BOOL finished = FALSE;
|
||||
|
||||
/* Skip all blank spaces in the stream. */
|
||||
format++;
|
||||
|
||||
while(TRUE)
|
||||
while((c = __getc(stream)) != EOF)
|
||||
{
|
||||
c = __getc(stream);
|
||||
if(c == EOF)
|
||||
{
|
||||
/* Hit the end of the stream. Due to an error? */
|
||||
if(num_conversions == 0 || ferror(stream))
|
||||
goto out;
|
||||
|
||||
finished = TRUE;
|
||||
break;
|
||||
}
|
||||
else if (isspace(c))
|
||||
if(isspace(c))
|
||||
{
|
||||
total_num_chars_read++;
|
||||
}
|
||||
@ -139,8 +127,17 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
}
|
||||
}
|
||||
|
||||
if(finished)
|
||||
if(c == EOF)
|
||||
{
|
||||
SHOWMSG("end of file");
|
||||
|
||||
/* Hit the end of the stream? */
|
||||
if(num_conversions == 0)
|
||||
goto out;
|
||||
|
||||
/* Finished... */
|
||||
break;
|
||||
}
|
||||
|
||||
/* Resume scanning. */
|
||||
continue;
|
||||
@ -159,8 +156,8 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
{
|
||||
SHOWMSG("end of file");
|
||||
|
||||
/* Hit the end of the stream. Due to an error? */
|
||||
if(num_conversions == 0 || ferror(stream))
|
||||
/* Hit the end of the stream. */
|
||||
if(num_conversions == 0)
|
||||
goto out;
|
||||
|
||||
break;
|
||||
@ -342,21 +339,9 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
conversion_type != 'n' &&
|
||||
conversion_type != '[')
|
||||
{
|
||||
BOOL finished = FALSE;
|
||||
|
||||
while(TRUE)
|
||||
while((c = __getc(stream)) != EOF)
|
||||
{
|
||||
c = __getc(stream);
|
||||
if(c == EOF)
|
||||
{
|
||||
/* Hit the end of the stream. Due to an error? */
|
||||
if(num_conversions == 0 || ferror(stream))
|
||||
goto out;
|
||||
|
||||
finished = TRUE;
|
||||
break;
|
||||
}
|
||||
else if (isspace(c))
|
||||
if(isspace(c))
|
||||
{
|
||||
total_num_chars_read++;
|
||||
}
|
||||
@ -372,9 +357,6 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(finished)
|
||||
break;
|
||||
}
|
||||
|
||||
num_chars_processed = 0;
|
||||
@ -431,8 +413,8 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
c = __getc(stream);
|
||||
if(c == EOF)
|
||||
{
|
||||
/* Bail out if we hit the end of the stream or an error occured. */
|
||||
if(num_conversions == 0 || ferror(stream))
|
||||
/* Bail out if we hit the end of the stream. */
|
||||
if(num_conversions == 0)
|
||||
goto out;
|
||||
|
||||
break;
|
||||
@ -612,7 +594,7 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
maximum_field_width--;
|
||||
}
|
||||
|
||||
if(c == EOF && ((num_chars_processed == 0 && num_conversions == 0) || ferror(stream)))
|
||||
if(c == EOF && num_chars_processed == 0 && num_conversions == 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -1203,7 +1185,7 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
}
|
||||
}
|
||||
|
||||
if(c == EOF && ((num_chars_processed == 0 && num_conversions == 0) || ferror(stream)))
|
||||
if(c == EOF && num_chars_processed == 0 && num_conversions == 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -1309,8 +1291,8 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
|
||||
/* The conversion is considered to have failed if an EOF was
|
||||
encountered before any non-whitespace characters could be
|
||||
converted. We also bail out if we hit an error. */
|
||||
if(c == EOF && ((num_chars_processed == 0 && num_conversions == 0) || ferror(stream)))
|
||||
converted. */
|
||||
if(c == EOF && num_chars_processed == 0 && num_conversions == 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -1433,8 +1415,8 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
{
|
||||
SHOWMSG("end of file");
|
||||
|
||||
/* Hit the end of the stream. Due to an error? */
|
||||
if(num_conversions == 0 || ferror(stream))
|
||||
/* Hit the end of the stream. */
|
||||
if(num_conversions == 0)
|
||||
goto out;
|
||||
|
||||
break;
|
||||
@ -1566,7 +1548,7 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
maximum_field_width--;
|
||||
}
|
||||
|
||||
if(c == EOF && ((num_chars_processed == 0 && num_conversions == 0) || ferror(stream)))
|
||||
if(c == EOF && num_chars_processed == 0 && num_conversions == 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 181
|
||||
#define DATE "26.10.2004"
|
||||
#define VERS "unix.lib 1.181"
|
||||
#define VSTRING "unix.lib 1.181 (26.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: unix.lib 1.181 (26.10.2004)"
|
||||
#define REVISION 182
|
||||
#define DATE "8.11.2004"
|
||||
#define VERS "unix.lib 1.182"
|
||||
#define VSTRING "unix.lib 1.182 (8.11.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: unix.lib 1.182 (8.11.2004)"
|
||||
|
||||
@ -1 +1 @@
|
||||
181
|
||||
182
|
||||
|
||||
Reference in New Issue
Block a user