diff --git a/library/amiga.lib_rev.h b/library/amiga.lib_rev.h index a582bbc..4a73f46 100644 --- a/library/amiga.lib_rev.h +++ b/library/amiga.lib_rev.h @@ -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)" diff --git a/library/amiga.lib_rev.rev b/library/amiga.lib_rev.rev index 3b4a6e8..960e7a8 100644 --- a/library/amiga.lib_rev.rev +++ b/library/amiga.lib_rev.rev @@ -1 +1 @@ -181 +182 diff --git a/library/c.lib_rev.h b/library/c.lib_rev.h index 7669b8b..4301859 100644 --- a/library/c.lib_rev.h +++ b/library/c.lib_rev.h @@ -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)" diff --git a/library/c.lib_rev.rev b/library/c.lib_rev.rev index 3b4a6e8..960e7a8 100644 --- a/library/c.lib_rev.rev +++ b/library/c.lib_rev.rev @@ -1 +1 @@ -181 +182 diff --git a/library/changes b/library/changes index a4a4a27..7f588de 100644 --- a/library/changes +++ b/library/changes @@ -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) diff --git a/library/debug.lib_rev.h b/library/debug.lib_rev.h index 05380b9..1e1b958 100644 --- a/library/debug.lib_rev.h +++ b/library/debug.lib_rev.h @@ -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)" diff --git a/library/debug.lib_rev.rev b/library/debug.lib_rev.rev index 3b4a6e8..960e7a8 100644 --- a/library/debug.lib_rev.rev +++ b/library/debug.lib_rev.rev @@ -1 +1 @@ -181 +182 diff --git a/library/m.lib_rev.h b/library/m.lib_rev.h index 9e36389..8a6e322 100644 --- a/library/m.lib_rev.h +++ b/library/m.lib_rev.h @@ -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)" diff --git a/library/m.lib_rev.rev b/library/m.lib_rev.rev index 3b4a6e8..960e7a8 100644 --- a/library/m.lib_rev.rev +++ b/library/m.lib_rev.rev @@ -1 +1 @@ -181 +182 diff --git a/library/m881.lib_rev.h b/library/m881.lib_rev.h index 2d10371..17cc925 100644 --- a/library/m881.lib_rev.h +++ b/library/m881.lib_rev.h @@ -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)" diff --git a/library/m881.lib_rev.rev b/library/m881.lib_rev.rev index 3b4a6e8..960e7a8 100644 --- a/library/m881.lib_rev.rev +++ b/library/m881.lib_rev.rev @@ -1 +1 @@ -181 +182 diff --git a/library/net.lib_rev.h b/library/net.lib_rev.h index 028625f..ea5a3e2 100644 --- a/library/net.lib_rev.h +++ b/library/net.lib_rev.h @@ -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)" diff --git a/library/net.lib_rev.rev b/library/net.lib_rev.rev index 3b4a6e8..960e7a8 100644 --- a/library/net.lib_rev.rev +++ b/library/net.lib_rev.rev @@ -1 +1 @@ -181 +182 diff --git a/library/stack.lib_rev.h b/library/stack.lib_rev.h index 6f8f8de..c15d033 100644 --- a/library/stack.lib_rev.h +++ b/library/stack.lib_rev.h @@ -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)" diff --git a/library/stack.lib_rev.rev b/library/stack.lib_rev.rev index 3b4a6e8..960e7a8 100644 --- a/library/stack.lib_rev.rev +++ b/library/stack.lib_rev.rev @@ -1 +1 @@ -181 +182 diff --git a/library/stdio_vfscanf.c b/library/stdio_vfscanf.c index bc083b8..5188da3 100644 --- a/library/stdio_vfscanf.c +++ b/library/stdio_vfscanf.c @@ -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; } diff --git a/library/unix.lib_rev.h b/library/unix.lib_rev.h index 3d4c1ca..8ab43c6 100644 --- a/library/unix.lib_rev.h +++ b/library/unix.lib_rev.h @@ -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)" diff --git a/library/unix.lib_rev.rev b/library/unix.lib_rev.rev index 3b4a6e8..960e7a8 100644 --- a/library/unix.lib_rev.rev +++ b/library/unix.lib_rev.rev @@ -1 +1 @@ -181 +182