1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Tue Jan 30 13:32:05 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>

* dirent/scandir.c: Allocate dirents with correct size for name, and
	copy with correct size.

	* hurd/hurdinit.c [! PIC] (map0): New function, on _hurd_preinit_hook.

	* stdio-common/vfscanf.c (TYPEMOD): New macro of all type modifier
	flag bits.
	(__vfscanf): Fix checking of extra type modifiers.

	* time/asia, time/australasia, time/backward: Updated from ADO 96b.

Tue Jan 30 12:17:26 1996  Ulrich Drepper  <drepper@ipd.info.uni-karlsruhe.de>

	* stdlib/strtod.c: Only negate exponent when there really is one.

	* stdio-common/vfscanf.c: Accept type modifiers on %n.
	Fix FP number parsing.
This commit is contained in:
Roland McGrath
1996-01-31 10:00:24 +00:00
parent f0b1101835
commit 01cdeca0c9
9 changed files with 134 additions and 53 deletions

View File

@ -1,3 +1,23 @@
Tue Jan 30 13:32:05 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* dirent/scandir.c: Allocate dirents with correct size for name, and
copy with correct size.
* hurd/hurdinit.c [! PIC] (map0): New function, on _hurd_preinit_hook.
* stdio-common/vfscanf.c (TYPEMOD): New macro of all type modifier
flag bits.
(__vfscanf): Fix checking of extra type modifiers.
* time/asia, time/australasia, time/backward: Updated from ADO 96b.
Tue Jan 30 12:17:26 1996 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* stdlib/strtod.c: Only negate exponent when there really is one.
* stdio-common/vfscanf.c: Accept type modifiers on %n.
Fix FP number parsing.
Mon Jan 29 21:53:40 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/stub/msync.c (msync): Declare third arg FLAGS.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -19,6 +19,7 @@ Cambridge, MA 02139, USA. */
#include <ansidecl.h>
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
int
@ -44,6 +45,8 @@ DEFUN(scandir, (dir, namelist, select, cmp),
while ((d = readdir (dp)) != NULL)
if (select == NULL || (*select) (d))
{
size_t dsize;
if (i == vsize)
{
struct dirent **new;
@ -61,11 +64,12 @@ DEFUN(scandir, (dir, namelist, select, cmp),
v = new;
}
v[i] = (struct dirent *) malloc (sizeof (**v));
dsize = &d->d_name[d->d_namlen + 1] - (char *) d;
v[i] = (struct dirent *) malloc (dsize);
if (v[i] == NULL)
goto lose;
*v[i++] = *d;
memcpy (v[i++], d, dsize);
}
if (errno != 0)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -197,3 +197,27 @@ _hurd_setproc (process_t procserver)
return 0;
}
#ifndef PIC
/* Map the page at address zero with no access allowed, so
dereferencing NULL will fault and no "anywhere" allocations
(e.g. the out of line memory containing the argument strings)
can be assigned address zero, which C says is not a valid pointer.
When dynamically linked, this will be done by the dynamic linker
before we run. */
static void map0 (void) __attribute__ ((unused));
text_set_element (_hurd_preinit_hook, map0);
static void
map0 (void)
{
vm_address_t addr = 0;
__vm_map (__mach_task_self (),
&addr, __vm_page_size, 0, 0, MACH_PORT_NULL, 0, 1,
VM_PROT_NONE, VM_PROT_NONE, VM_INHERIT_COPY);
}
#endif

View File

@ -762,7 +762,7 @@ to get a Coordinated Universal Time value. It has syntax like
[@code{+}|@code{-}]@var{hh}[@code{:}@var{mm}[@code{:}@var{ss}]]. This
is positive if the local time zone is west of the Prime Meridian and
negative if it is east. The hour must be between @code{0} and
@code{24}, and the minute and seconds between @code{0} and @code{59}.
@code{23}, and the minute and seconds between @code{0} and @code{59}.
For example, here is how we would specify Eastern Standard Time, but
without any daylight savings time alternative:

View File

@ -45,6 +45,8 @@ Cambridge, MA 02139, USA. */
# define GROUP 0x080 /* ': group numbers */
# define MALLOC 0x100 /* a: malloc strings */
# define TYPEMOD (LONG|LONGDBL|SHORT)
#ifdef USE_IN_LIBIO
# include <libioP.h>
@ -114,7 +116,7 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
register int flags; /* Modifiers for current format element. */
/* Status for reading F-P nums. */
char got_dot, got_e;
char got_dot, got_e, negative;
/* If a [...] is a [^...]. */
char not_in;
/* Base for integral numbers. */
@ -307,7 +309,7 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
{
case 'h':
/* int's are short int's. */
if (flags & (LONG|LONGDBL))
if (flags & TYPEMOD)
/* Signal illegal format element. */
conv_error ();
flags |= SHORT;
@ -328,12 +330,15 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
case 'q':
case 'L':
/* double's are long double's, and int's are long long int's. */
if (flags & (LONG|SHORT))
if (flags & TYPEMOD)
/* Signal illegal format element. */
conv_error ();
flags |= LONGDBL;
break;
case 'a':
if (flags & TYPEMOD)
/* Signal illegal format element. */
conv_error ();
/* String conversions (%s, %[) take a `char **'
arg and fill it in with a malloc'd pointer. */
flags |= MALLOC;
@ -363,8 +368,18 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
break;
case 'n': /* Answer number of assignments done. */
/* Corrigendum 1 to ISO C 1990 describes the allowed flags
with the 'n' conversion specifier. */
if (!(flags & SUPPRESS))
*ARG (int *) = read_in - 1; /* Don't count the read-ahead. */
/* Don't count the read-ahead. */
if (flags & LONGDBL)
*ARG (long long int *) = read_in - 1;
else if (flags & LONG)
*ARG (long int *) = read_in - 1;
else if (flags & SHORT)
*ARG (short int *) = read_in - 1;
else
*ARG (int *) = read_in - 1;
break;
case 'c': /* Match characters. */
@ -512,7 +527,6 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
{
if (width > 0)
--width;
ADDW ('0');
(void) inchar ();
@ -612,13 +626,15 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
/* Check for a sign. */
if (c == '-' || c == '+')
{
ADDW (c);
negative = c == '-';
if (inchar () == EOF)
/* EOF is only an input error before we read any chars. */
conv_error ();
if (width > 0)
--width;
}
else
negative = 0;
got_dot = got_e = 0;
do
@ -628,7 +644,7 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
else if (got_e && wp[wpsize - 1] == 'e'
&& (c == '-' || c == '+'))
ADDW (c);
else if (!got_e && tolower (c) == 'e')
else if (wpsize > 0 && !got_e && tolower (c) == 'e')
{
ADDW ('e');
got_e = got_dot = 1;
@ -644,12 +660,10 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
break;
if (width > 0)
--width;
} while (inchar () != EOF && width != 0);
}
while (inchar () != EOF && width != 0);
if (wpsize == 0)
conv_error();
if (wp[wpsize - 1] == '-' || wp[wpsize - 1] == '+'
|| wp[wpsize - 1] == 'e')
conv_error ();
/* Convert the number. */
@ -658,19 +672,19 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
{
long double d = __strtold_internal (wp, &tw, flags & GROUP);
if (!(flags & SUPPRESS) && tw != wp)
*ARG (long double *) = d;
*ARG (long double *) = negative ? -d : d;
}
else if (flags & LONG)
{
double d = __strtod_internal (wp, &tw, flags & GROUP);
if (!(flags & SUPPRESS) && tw != wp)
*ARG (double *) = d;
*ARG (double *) = negative ? -d : d;
}
else
{
float d = __strtof_internal (wp, &tw, flags & GROUP);
if (!(flags & SUPPRESS) && tw != wp)
*ARG (float *) = d;
*ARG (float *) = negative ? -d : d;
}
if (tw == wp)
@ -738,7 +752,8 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
STRING_ADD_CHAR (c);
if (width > 0)
--width;
} while (inchar () != EOF && width != 0);
}
while (inchar () != EOF && width != 0);
if (read_in == num.ul)
conv_error ();

View File

@ -1,5 +1,5 @@
/* Read decimal floating point numbers.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Contributed by Ulrich Drepper.
This file is part of the GNU C Library.
@ -545,13 +545,13 @@ INTERNAL (STRTOF) (nptr, endptr, group)
c = *++cp;
}
while (isdigit (c));
}
else
cp = expp;
if (exp_negative)
exponent = -exponent;
}
else
cp = expp;
}
/* We don't want to have to work with trailing zeroes after the radix. */
if (dig_no > int_no)

View File

@ -1,4 +1,4 @@
# @(#)asia 7.17
# @(#)asia 7.18
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
@ -499,7 +499,7 @@ Rule Zion 1996 only - Sep 16 0:00 0:00 S
Rule Zion 1997 1998 - Oct Sun>=14 0:00 0:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Tel_Aviv 2:19:04 - LMT 1880
Zone Asia/Jerusalem 2:20:56 - LMT 1880
2:21 - JMT 1918
2:00 Zion I%sT

View File

@ -1,4 +1,4 @@
# @(#)australasia 7.24
# @(#)australasia 7.25
# This file also includes Pacific islands.
# Notes are at the end of this file
@ -208,15 +208,21 @@ Zone Pacific/Johnston -10:00 - HST
# uninhabited
# Kiribati
# From Paul Eggert (1996-01-22):
# Today's _Wall Street Journal_ (page 1) reports that Kiribati
# ``declared it the same day throught the country as of Jan. 1, 1995''
# as part of the competition to be first into the 21st century.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Tarawa 11:32:04 - LMT 1901 # Bairiki
12:00 - NZST
Zone Pacific/Enderbury -11:24:20 - LMT 1901
-12:00 - KJT 1979 Oct
-11:00 - SST
-11:00 - SST 1995
13:00 - TGT
Zone Pacific/Kiritimati -10:29:20 - LMT 1901
-10:40 - LIT 1979 Oct # Line Is Time
-10:00 - THT
-10:00 - THT 1995
14:00 - KRT
# N Mariana Is
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@ -362,6 +368,10 @@ Zone Pacific/Fakaofo -11:24:56 - LMT 1901
-10:00 - THT
# Tonga
# From Paul Eggert (1996-01-22):
# Today's _Wall Street Journal_ (page 1) reports that ``Tonga has been plotting
# to sneak ahead of [New Zealanders] by introducing daylight-saving time.''
# But since Kiribati has moved the Date Line it's not clear what Tonga will do.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Tongatapu 12:19:20 - LMT 1901
12:20 - TMT 1968 Oct
@ -403,7 +413,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# go ahead and edit the file (and please send any changes to
# tz@elsie.nci.nih.gov for general use in the future).
# From Paul Eggert <eggert@twinsun.com> (August 18, 1994):
# From Paul Eggert <eggert@twinsun.com> (1996-01-22);
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks, The International Atlas (3rd edition),
# San Diego: ACS Publications, Inc. (1991).
@ -436,6 +446,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# 12:00 NZST NZDT New Zealand
# 12:45 CHST CHDT Chatham*
# 13:00 TGT Tongatapu*
# 14:00 KRT Kiritimati*
# -12:00 KJT Kwajalein (no longer used)*
# -11:00 SST Samoa
# -10:40 LIT Line Is (no longer used)*

View File

@ -1,9 +1,15 @@
# @(#)backward 7.9
# @(#)backward 7.13
# This file provides links between current names for time zones
# and their old names. Many names changed in late 1993.
Link Australia/Canberra Australia/ACT
Link America/Adak America/Atka
Link America/Indianapolis America/Fort_Wayne
Link America/Indiana/Knox America/Knox_IN
Link America/St_Thomas America/Virgin
Link Asia/Jerusalem Asia/Tel_Aviv
Link Australia/Sydney Australia/ACT
Link Australia/Sydney Australia/Canberra
Link Australia/Lord_Howe Australia/LHI
Link Australia/Sydney Australia/NSW
Link Australia/Darwin Australia/North
@ -40,7 +46,7 @@ Link Etc/Greenwich Greenwich
Link Asia/Hong_Kong Hongkong
Link Atlantic/Reykjavik Iceland
Link Asia/Tehran Iran
Link Asia/Tel_Aviv Israel
Link Asia/Jerusalem Israel
Link America/Jamaica Jamaica
Link Asia/Tokyo Japan
Link Pacific/Kwajalein Kwajalein
@ -48,9 +54,10 @@ Link Africa/Tripoli Libya
Link America/Tijuana Mexico/BajaNorte
Link America/Mazatlan Mexico/BajaSur
Link America/Mexico_City Mexico/General
Link America/Shiprock Navajo
Link America/Denver Navajo
Link Pacific/Auckland NZ
Link Pacific/Chatham NZ-CHAT
Link Pacific/Pago_Pago Pacific/Samoa
Link Asia/Shanghai PRC
Link Europe/Warsaw Poland
Link Europe/Lisbon Portugal
@ -60,17 +67,17 @@ Link Asia/Singapore Singapore
Link Europe/Istanbul Turkey
Link Etc/UCT UCT
Link America/Anchorage US/Alaska
Link America/Atka US/Aleutian
Link America/Adak US/Aleutian
Link America/Phoenix US/Arizona
Link America/Chicago US/Central
Link America/Fort_Wayne US/East-Indiana
Link America/Indianapolis US/East-Indiana
Link America/New_York US/Eastern
Link Pacific/Honolulu US/Hawaii
Link America/Knox_IN US/Indiana-Starke
Link America/Indiana/Knox US/Indiana-Starke
Link America/Detroit US/Michigan
Link America/Denver US/Mountain
Link America/Los_Angeles US/Pacific
Link Pacific/Samoa US/Samoa
Link Pacific/Pago_Pago US/Samoa
Link Etc/UTC UTC
Link Etc/Universal Universal
Link Europe/Moscow W-SU