mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Tue Dec 5 02:27:32 1995 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* libio/Makefile [routines]: Remove iofscanf, add iopopen, pclose.
* libio/iofscanf.c: Remove file.
* libio/iogetdelim.c (_IO_getdelim): Correct stupid bug at string
termination.
* libio/iopopen.c: New file from GNU libio.
* libio/memstream.c: Fixed bug in fclose handling. Instead of
providing a close callback we need a finish callback.
* libio/pclose.c: New file. Derived from popen.c in GNU libio.
* posix/gnu/types.h: Fixed typo.
* stdio-common/errnobug.c: fputs returns EOF in error case. Do
not test for != 0.
* stdio-common/printf-parse.h (parse_one_spec): Do not force
padding with ' ' if precision is given. Fix by HJ Lu.
* stdio-common/printf_fp.c: Fix comment.
* stdio-common/tfformat.c, stdio-common/tiformat.c,
stdio-common/tstdiomisc.c: New files from GNU libio test suite.
* stdio-common/tstgetln.c: Provide ssize_t type when testing
libio.
* stdio-common/vfprintf.c (outchar): Use PUTC instead of putc.
(vfprintf): Cleasr args_type array before using it.
When printing 0 as an integer with precision 0 nothing must be
written for the number.
Based on patch by HJ Lu.
* stdio-common/vfscanf.c: Remove fixed input buffer. Now we
have a dynamically extended buffer.
* stdlib/strtod.c: Merge with version in Linux libc. This fixes
some bugs with handling of very small numbers and has different
solution for formaer patches.
* sysdeps/i386/i586/add_n.S, sysdeps/i386/i586/sub_n.S: Rename
macros r1 and r2 to t1, and t2 resp. This is necessary because
glibc headers also define r1.
Tue Dec 5 02:27:32 1995 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* libio/Makefile [routines]: Remove iofscanf, add iopopen, pclose.
* libio/iofscanf.c: Remove file.
* libio/iogetdelim.c (_IO_getdelim): Correct stupid bug at string
termination.
* libio/iopopen.c: New file from GNU libio.
* libio/memstream.c: Fixed bug in fclose handling. Instead of
providing a close callback we need a finish callback.
* libio/pclose.c: New file. Derived from popen.c in GNU libio.
* posix/gnu/types.h: Fixed typo.
* stdio-common/errnobug.c: fputs returns EOF in error case. Do
not test for != 0.
* stdio-common/printf-parse.h (parse_one_spec): Do not force
padding with ' ' if precision is given. Fix by HJ Lu.
* stdio-common/printf_fp.c: Fix comment.
* stdio-common/tfformat.c, stdio-common/tiformat.c,
stdio-common/tstdiomisc.c: New files from GNU libio test suite.
* stdio-common/tstgetln.c: Provide ssize_t type when testing
libio.
* stdio-common/vfprintf.c (outchar): Use PUTC instead of putc.
(vfprintf): Cleasr args_type array before using it.
When printing 0 as an integer with precision 0 nothing must be
written for the number.
Based on patch by HJ Lu.
* stdio-common/vfscanf.c: Remove fixed input buffer. Now we
have a dynamically extended buffer.
* stdlib/strtod.c: Merge with version in Linux libc. This fixes
some bugs with handling of very small numbers and has different
solution for formaer patches.
* sysdeps/i386/i586/add_n.S, sysdeps/i386/i586/sub_n.S: Rename
macros r1 and r2 to t1, and t2 resp. This is necessary because
glibc headers also define r1.
This commit is contained in:
@@ -96,7 +96,7 @@ ssize_t __printf_pad __P ((FILE *, char pad, size_t n));
|
||||
do \
|
||||
{ \
|
||||
register const int outc = (x); \
|
||||
if (putc (outc, s) == EOF) \
|
||||
if (PUTC (outc, s) == EOF) \
|
||||
return -1; \
|
||||
else \
|
||||
++done; \
|
||||
@@ -230,11 +230,12 @@ vfprintf (s, format, ap)
|
||||
|
||||
/* Allocate memory for the argument descriptions. */
|
||||
args_type = alloca (nargs * sizeof (int));
|
||||
memset (args_type, 0, nargs * sizeof (int));
|
||||
args_value = alloca (nargs * sizeof (union printf_arg));
|
||||
|
||||
/* XXX Could do sanity check here:
|
||||
Initialize args_type elts to zero.
|
||||
If any is still zero after this loop, format is invalid. */
|
||||
/* XXX Could do sanity check here: If any element in ARGS_TYPE is
|
||||
still zero after this loop, format is invalid. For now we simply
|
||||
use 0 as the value. */
|
||||
|
||||
/* Fill in the types of all the arguments. */
|
||||
for (cnt = 0; cnt < nspecs; ++cnt)
|
||||
@@ -287,6 +288,8 @@ vfprintf (s, format, ap)
|
||||
default:
|
||||
if ((args_type[cnt] & PA_FLAG_PTR) != 0)
|
||||
args_value[cnt].pa_pointer = va_arg (ap, void *);
|
||||
else
|
||||
args_value[cnt].pa_long_double = 0.0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -420,15 +423,27 @@ vfprintf (s, format, ap)
|
||||
char *const workend = &work[sizeof(work) - 1];
|
||||
register char *w;
|
||||
|
||||
/* Supply a default precision if none was given. */
|
||||
if (specs[cnt].info.prec == -1)
|
||||
specs[cnt].info.prec = 1;
|
||||
/* Supply a default precision if none was given. */
|
||||
specs[cnt].info.prec = 1;
|
||||
else
|
||||
/* We have to take care for the '0' flag. If a
|
||||
precision is given it must be ignored. */
|
||||
specs[cnt].info.pad = ' ';
|
||||
|
||||
/* Put the number in WORK. */
|
||||
w = _itoa (num, workend + 1, base, specs[cnt].info.spec == 'X');
|
||||
w -= 1;
|
||||
if (specs[cnt].info.group && grouping)
|
||||
w = group_number (w, workend, grouping, thousands_sep);
|
||||
/* If the precision is 0 and the number is 0 nothing has
|
||||
to be written for the number. */
|
||||
if (specs[cnt].info.prec == 0 && num == 0)
|
||||
w = workend;
|
||||
else
|
||||
{
|
||||
/* Put the number in WORK. */
|
||||
w = _itoa (num, workend + 1, base,
|
||||
specs[cnt].info.spec == 'X');
|
||||
w -= 1;
|
||||
if (specs[cnt].info.group && grouping)
|
||||
w = group_number (w, workend, grouping, thousands_sep);
|
||||
}
|
||||
specs[cnt].info.width -= workend - w;
|
||||
specs[cnt].info.prec -= workend - w;
|
||||
|
||||
@@ -618,8 +633,18 @@ vfprintf (s, format, ap)
|
||||
}
|
||||
|
||||
#ifdef USE_IN_LIBIO
|
||||
#undef vfprintf
|
||||
# undef vfprintf
|
||||
# ifdef strong_alias
|
||||
/* This is for glibc. */
|
||||
strong_alias (_IO_vfprintf, vfprintf)
|
||||
# else
|
||||
# if defined __ELF__ || defined __GNU_LIBRARY__
|
||||
# include <gnu-stabs.h>
|
||||
# ifdef weak_alias
|
||||
weak_alias (_IO_vfprintf, vfprintf);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user