mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
308b1321d5 | ||
|
|
99e6856c11 | ||
|
|
b252f90d66 | ||
|
|
1ed26d0a60 | ||
|
|
4dd74de299 | ||
|
|
3b5a4a32a4 | ||
|
|
7f7ca50d06 | ||
|
|
0ed8ef67ed | ||
|
|
267bdc4be6 | ||
|
|
a7bac89279 |
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id: GNUmakefile.68k,v 1.11 2004-10-07 09:20:44 obarthel Exp $
|
||||
# $Id: GNUmakefile.68k,v 1.13 2004-10-26 16:25:03 obarthel Exp $
|
||||
#
|
||||
# :ts=8
|
||||
#
|
||||
@@ -9,7 +9,7 @@
|
||||
CC = gcc
|
||||
AR = ar -q
|
||||
RANLIB = ranlib
|
||||
COPY = copy clone
|
||||
COPY = copy clone buf=0
|
||||
DELETE = delete all quiet
|
||||
MAKEDIR = makedir
|
||||
MAKE = make -f GNUmakefile.68k
|
||||
@@ -688,7 +688,6 @@ LIBS_68K := $(LIBC_OBJS)/libc.a $(LIBSTACK_OBJS)/libstack.a $(LIBUNIX_OBJS)/libu
|
||||
$(LIBNET_OBJS)/libnet.a $(LIBDEBUG_OBJS)/libdebug.a $(LIBAMIGA_OBJS)/libamiga.a \
|
||||
$(LIBM_OBJS)/libm.a
|
||||
LIBS_020 := $(LIBM881_OBJS)/libm881.a $(LIBS_68K)
|
||||
#LIBS_020 := $(LIBS_68K)
|
||||
|
||||
##############################################################################
|
||||
|
||||
@@ -714,8 +713,8 @@ all: \
|
||||
lib/mainnb.o \
|
||||
lib/mainb.o \
|
||||
lib/mainb32.o \
|
||||
lib/libm.a \
|
||||
lib/libm020/libm.a \
|
||||
lib/libm.a \
|
||||
lib/libb/libm.a \
|
||||
lib/libb/libm020/libm.a \
|
||||
lib/libb32/libm020/libm.a
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 179
|
||||
#define DATE "22.10.2004"
|
||||
#define VERS "amiga.lib 1.179"
|
||||
#define VSTRING "amiga.lib 1.179 (22.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: amiga.lib 1.179 (22.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 @@
|
||||
179
|
||||
182
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 179
|
||||
#define DATE "22.10.2004"
|
||||
#define VERS "c.lib 1.179"
|
||||
#define VSTRING "c.lib 1.179 (22.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: c.lib 1.179 (22.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 @@
|
||||
179
|
||||
182
|
||||
|
||||
@@ -1,3 +1,44 @@
|
||||
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.
|
||||
|
||||
|
||||
|
||||
c.lib 1.181 (26.10.2004)
|
||||
|
||||
- The scanf() family now always returns the number of assignments made
|
||||
unless an error occured or an EOF was hit during conversion before the
|
||||
first assignment could be made.
|
||||
|
||||
- strtok() did not terminate properly if the last token in the string
|
||||
did not end with a separator character but with a '\0' byte. Fixed.
|
||||
|
||||
- The directory scanning functions opendir/closedir did not get the global
|
||||
directory data tracking data structure initialized which later led to
|
||||
Enforcer hits and maybe trashed memory. Fixed.
|
||||
|
||||
|
||||
c.lib 1.180 (23.10.2004)
|
||||
|
||||
- The printf() family now produces no output at all for %e, %f and %g if the
|
||||
floating point support code is disabled. Previously, a minimum field width
|
||||
specification could take effect, printing a series of 0 or blank space
|
||||
characters where no output should have been produced.
|
||||
|
||||
|
||||
c.lib 1.179 (22.10.2004)
|
||||
|
||||
- The scanf() family no longer assumes that a leading '0' indicates that the
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 179
|
||||
#define DATE "22.10.2004"
|
||||
#define VERS "debug.lib 1.179"
|
||||
#define VSTRING "debug.lib 1.179 (22.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: debug.lib 1.179 (22.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 @@
|
||||
179
|
||||
182
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_data.c,v 1.3 2004-08-07 10:24:04 obarthel Exp $
|
||||
* $Id: dirent_data.c,v 1.4 2004-10-24 20:03:42 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -38,7 +38,7 @@
|
||||
/****************************************************************************/
|
||||
|
||||
/* Directories being scanned whose locks need to be freed when shutting down. */
|
||||
struct MinList __directory_list;
|
||||
struct MinList NOCOMMON __directory_list;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_headers.h,v 1.1.1.1 2004-07-26 16:30:30 obarthel Exp $
|
||||
* $Id: dirent_headers.h,v 1.2 2004-10-24 20:03:42 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -42,6 +42,12 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _MACROS_H
|
||||
#include "macros.h"
|
||||
#endif /* _MACROS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct DirectoryHandle
|
||||
{
|
||||
struct MinNode dh_MinNode;
|
||||
@@ -56,7 +62,7 @@ struct DirectoryHandle
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern struct MinList __directory_list;
|
||||
extern struct MinList NOCOMMON __directory_list;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 179
|
||||
#define DATE "22.10.2004"
|
||||
#define VERS "m.lib 1.179"
|
||||
#define VSTRING "m.lib 1.179 (22.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: m.lib 1.179 (22.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 @@
|
||||
179
|
||||
182
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 179
|
||||
#define DATE "22.10.2004"
|
||||
#define VERS "m881.lib 1.179"
|
||||
#define VSTRING "m881.lib 1.179 (22.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: m881.lib 1.179 (22.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 @@
|
||||
179
|
||||
182
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 179
|
||||
#define DATE "22.10.2004"
|
||||
#define VERS "net.lib 1.179"
|
||||
#define VSTRING "net.lib 1.179 (22.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: net.lib 1.179 (22.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 @@
|
||||
179
|
||||
182
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
c.lib 1.179 (22.10.2004)
|
||||
c.lib 1.180 (23.10.2004)
|
||||
|
||||
- The printf() family now produces no output at all for floating point
|
||||
numbers (%e, %f and %g) if the floating point support code is disabled.
|
||||
In previous versions of the library some output (series of 0 or blank
|
||||
space characters) could still be produced.
|
||||
|
||||
- The scanf() family no longer ignores a conversion request of
|
||||
type '%x' (hexadecimal) and treats the number to be processed
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 179
|
||||
#define DATE "22.10.2004"
|
||||
#define VERS "stack.lib 1.179"
|
||||
#define VSTRING "stack.lib 1.179 (22.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: stack.lib 1.179 (22.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 @@
|
||||
179
|
||||
182
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_openiob.c,v 1.1.1.1 2004-07-26 16:31:37 obarthel Exp $
|
||||
* $Id: stdio_openiob.c,v 1.3 2004-11-03 15:39:04 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -48,9 +48,7 @@ __open_iob(const char *filename, const char *mode, int file_descriptor, int slot
|
||||
{
|
||||
ULONG file_flags;
|
||||
int result = -1;
|
||||
char actual_mode[8];
|
||||
int open_mode;
|
||||
size_t mode_len,len,i;
|
||||
struct fd * fd = NULL;
|
||||
STRPTR buffer = NULL;
|
||||
STRPTR aligned_buffer;
|
||||
@@ -86,78 +84,49 @@ __open_iob(const char *filename, const char *mode, int file_descriptor, int slot
|
||||
}
|
||||
}
|
||||
|
||||
/* Options can follow the mode string, separated by a comma.
|
||||
* We don't support any of those.
|
||||
*/
|
||||
len = mode_len = strlen(mode);
|
||||
for(i = 0 ; i < len ; i++)
|
||||
/* The first character selects the access mode: read, write or append. */
|
||||
switch(mode[0])
|
||||
{
|
||||
if(mode[i] == ',')
|
||||
{
|
||||
mode_len = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 'r':
|
||||
|
||||
/* Keep only the first few letters of the mode string. */
|
||||
if(mode_len > sizeof(actual_mode)-1)
|
||||
mode_len = sizeof(actual_mode)-1;
|
||||
|
||||
memmove(actual_mode,mode,mode_len);
|
||||
actual_mode[mode_len] = '\0';
|
||||
|
||||
SHOWSTRING(actual_mode);
|
||||
|
||||
if(strcmp(actual_mode,"r") == SAME || strcmp(actual_mode,"rb") == SAME)
|
||||
{
|
||||
SHOWMSG("read-only");
|
||||
SHOWMSG("read mode");
|
||||
|
||||
open_mode = O_RDONLY;
|
||||
file_flags = IOBF_READ;
|
||||
}
|
||||
else if (strcmp(actual_mode,"w") == SAME || strcmp(actual_mode,"wb") == SAME)
|
||||
{
|
||||
SHOWMSG("write-only");
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
|
||||
SHOWMSG("write mode");
|
||||
|
||||
open_mode = O_WRONLY | O_CREAT | O_TRUNC;
|
||||
file_flags = IOBF_WRITE;
|
||||
}
|
||||
else if (strcmp(actual_mode,"a") == SAME || strcmp(actual_mode,"ab") == SAME)
|
||||
{
|
||||
SHOWMSG("write-only; append");
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
|
||||
SHOWMSG("append mode");
|
||||
|
||||
open_mode = O_WRONLY | O_CREAT | O_APPEND;
|
||||
file_flags = IOBF_WRITE;
|
||||
}
|
||||
else if (strcmp(actual_mode,"r+") == SAME || strcmp(actual_mode,"rb+") == SAME || strcmp(actual_mode,"r+b") == SAME)
|
||||
{
|
||||
SHOWMSG("read/write; don't overwrite");
|
||||
break;
|
||||
|
||||
open_mode = O_RDWR;
|
||||
file_flags = IOBF_READ | IOBF_WRITE;
|
||||
}
|
||||
else if (strcmp(actual_mode,"w+") == SAME || strcmp(actual_mode,"wb+") == SAME || strcmp(actual_mode,"w+b") == SAME)
|
||||
{
|
||||
SHOWMSG("read/write; overwrite");
|
||||
default:
|
||||
|
||||
open_mode = O_RDWR | O_CREAT | O_TRUNC;
|
||||
file_flags = IOBF_READ | IOBF_WRITE;
|
||||
}
|
||||
else if (strcmp(actual_mode,"a+") == SAME || strcmp(actual_mode,"ab+") == SAME || strcmp(actual_mode,"a+b") == SAME)
|
||||
{
|
||||
SHOWMSG("read/write; append; don't overwrite");
|
||||
|
||||
open_mode = O_RDWR | O_CREAT | O_APPEND;
|
||||
file_flags = IOBF_READ | IOBF_WRITE;
|
||||
}
|
||||
else
|
||||
{
|
||||
SHOWMSG("unsupported file open mode");
|
||||
D(("unsupported file open mode '%lc'",mode[0]));
|
||||
|
||||
errno = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* If the second or third character is a '+', switch to read/write mode. */
|
||||
if((mode[1] == '+') || (mode[1] != '\0' && mode[2] == '+'))
|
||||
{
|
||||
SHOWMSG("read/write access");
|
||||
|
||||
CLEAR_FLAG(open_mode,O_RDONLY);
|
||||
CLEAR_FLAG(open_mode,O_WRONLY);
|
||||
|
||||
SET_FLAG(open_mode,O_RDWR);
|
||||
}
|
||||
|
||||
SHOWMSG("allocating file buffer");
|
||||
|
||||
/* Allocate a little more memory than necessary. */
|
||||
@@ -193,12 +162,21 @@ __open_iob(const char *filename, const char *mode, int file_descriptor, int slot
|
||||
CLEAR_FLAG(fd->fd_Flags,FDF_APPEND);
|
||||
}
|
||||
|
||||
/* Figure out the buffered file access mode by looking at the open mode. */
|
||||
file_flags = IOBF_IN_USE | IOBF_NO_NUL;
|
||||
|
||||
if(FLAG_IS_SET(open_mode,O_RDONLY) || FLAG_IS_SET(open_mode,O_RDWR))
|
||||
SET_FLAG(file_flags,IOBF_READ);
|
||||
|
||||
if(FLAG_IS_SET(open_mode,O_WRONLY) || FLAG_IS_SET(open_mode,O_RDWR))
|
||||
SET_FLAG(file_flags,IOBF_WRITE);
|
||||
|
||||
__initialize_iob(file,(HOOKFUNC)__iob_hook_entry,
|
||||
buffer,
|
||||
aligned_buffer,BUFSIZ,
|
||||
file_descriptor,
|
||||
slot_number,
|
||||
IOBF_IN_USE | file_flags | IOBF_NO_NUL);
|
||||
file_flags);
|
||||
|
||||
buffer = NULL;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_vfprintf.c,v 1.5 2004-09-10 07:39:19 obarthel Exp $
|
||||
* $Id: stdio_vfprintf.c,v 1.6 2004-10-23 16:38:18 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -979,15 +979,8 @@ vfprintf(FILE * stream,const char * format, va_list arg)
|
||||
else
|
||||
(void)va_arg(arg, double);
|
||||
|
||||
#ifndef NDEBUG
|
||||
{
|
||||
output_buffer = "*FLOATING POINT NUMBER*";
|
||||
output_len = strlen(output_buffer);
|
||||
}
|
||||
#endif /* NDEBUG */
|
||||
|
||||
CLEAR_FLAG(format_flags,FORMATF_ProduceSign);
|
||||
CLEAR_FLAG(format_flags,FORMATF_ProduceSpace);
|
||||
minimum_field_width = 0;
|
||||
format_flags = 0;
|
||||
}
|
||||
#endif /* FLOATING_POINT_SUPPORT */
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_vfscanf.c,v 1.3 2004-10-22 10:57:53 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;
|
||||
@@ -305,9 +302,11 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
break;
|
||||
|
||||
/* It's a floating point number. */
|
||||
case 'f':
|
||||
case 'e':
|
||||
case 'E':
|
||||
case 'f':
|
||||
case 'g':
|
||||
case 'G':
|
||||
|
||||
conversion_type = 'f';
|
||||
format++;
|
||||
@@ -321,6 +320,7 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
case 's': /* string */
|
||||
case 'u': /* unsigned integer */
|
||||
case 'x': /* unsigned integer in hexadecimal format */
|
||||
case 'X': /* unsigned integer in hexadecimal format */
|
||||
case '%': /* the % character */
|
||||
case '[': /* a range of characters */
|
||||
|
||||
@@ -339,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++;
|
||||
}
|
||||
@@ -369,9 +357,6 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(finished)
|
||||
break;
|
||||
}
|
||||
|
||||
num_chars_processed = 0;
|
||||
@@ -428,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;
|
||||
@@ -609,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;
|
||||
}
|
||||
|
||||
@@ -1200,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;
|
||||
}
|
||||
|
||||
@@ -1306,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 || ferror(stream)))
|
||||
converted. */
|
||||
if(c == EOF && num_chars_processed == 0 && num_conversions == 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1430,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;
|
||||
@@ -1563,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;
|
||||
}
|
||||
|
||||
@@ -1577,7 +1562,6 @@ __vfscanf(FILE *stream, const char *format, va_list arg)
|
||||
}
|
||||
}
|
||||
|
||||
if(num_conversions > 0)
|
||||
result = num_assignments;
|
||||
|
||||
out:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: string_strtok.c,v 1.1.1.1 2004-07-26 16:32:20 obarthel Exp $
|
||||
* $Id: string_strtok.c,v 1.2 2004-10-25 19:53:15 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -89,9 +89,12 @@ strtok(char *str, const char *separator_set)
|
||||
goto out;
|
||||
|
||||
/* This is where the search can resume later. */
|
||||
last = &str[size+1];
|
||||
if((*last) == '\0')
|
||||
last = NULL;
|
||||
last = &str[size];
|
||||
|
||||
/* If we didn't hit the end of the string already,
|
||||
skip the separator. */
|
||||
if((*last) != '\0')
|
||||
last++;
|
||||
|
||||
/* This is the token we found; make sure that
|
||||
it looks like a valid string. */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 179
|
||||
#define DATE "22.10.2004"
|
||||
#define VERS "unix.lib 1.179"
|
||||
#define VSTRING "unix.lib 1.179 (22.10.2004)\r\n"
|
||||
#define VERSTAG "\0$VER: unix.lib 1.179 (22.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 @@
|
||||
179
|
||||
182
|
||||
|
||||
Reference in New Issue
Block a user