Commit Graph

199 Commits

Author SHA1 Message Date
hubertf
681b2f48bc remove(3) doesn't remove dangling links due to stat() returning an
error. Now try lstat() before really aborting.
OK'd by thorpej.
1997-10-06 00:28:14 +00:00
phil
a25ce426d4 Remove the flag test when seeing if _double is zero or not. We
are only testing for the cvt problem, not for alternate forms.
This change makes %#e and %e both correctly print 0.  It is just
a question of is it the proper number of zeros or not?
1997-08-29 05:31:11 +00:00
kleink
c213a3af8b Add missing `STANDARDS' compliance statements. As we #define _POSIX_VERSION
to 199009L, bump existing statements to 1003.1-1990.
1997-07-14 23:19:39 +00:00
christos
0c339c443a Fix RCSID's
Fix gcc warnings.
Add prototypes for functions that were declared in more than one place
to local.h or extern.h and use that instead.
1997-07-13 20:15:17 +00:00
christos
23312f88d4 Fix RCSID's
Fix gcc warnings.
Add prototypes for functions that were declared in more than one place
to local.h or extern.h and use that instead.
1997-07-13 20:14:49 +00:00
phil
4de11835a6 Modify to have _gettemp generate different names on repeated calls even if the
file was not created.  Tempnam modified to make use of full possibilities.
1997-07-07 17:47:00 +00:00
kleink
72a0532ba2 Add an Xref to rmdir(2). 1997-06-03 22:28:25 +00:00
kleink
5ddc3f534d Always use rmdir(2) to remove a directory, as the file system may prohibit
using unlink(2) on directories.
1997-06-03 22:26:38 +00:00
kleink
5a4d11e445 Upon an attempt to write to a stream that can't be written to, set errno
to EBADF.
1997-05-03 09:01:48 +00:00
lukem
c3e5a4fdb6 use lstat() instead of stat() when checking for existance.
from Keith Bostic <bostic@bostic.com>
1997-04-08 06:14:39 +00:00
kleink
f87eccf5b4 RCSid police 1997-04-02 12:50:23 +00:00
lukem
0607611785 * clarify that tempnam and tmpnam still have problems
* advise mkstemp() over mktemp(), tmpnam(), tempnam(), and indicate
  link-time warning if latter 3 are used
* minor cleanups
1997-03-24 11:39:10 +00:00
lukem
15d4b08009 explain why mktemp() should generally be avoided in favour of mkstemp() 1997-03-24 09:22:15 +00:00
lukem
1960b7137d add warn_refs for mktemp(), tempnam(), and tmpnam() since most code
use these incorrectly. mkstemp() is ok however. inspired by openbsd
1997-03-16 05:00:38 +00:00
mouse
ff44468136 alternate -> alternative, per PR 2643 1997-03-08 13:36:38 +00:00
mrg
9cd5492c02 - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
1997-01-23 14:01:45 +00:00
mikel
37ee5d07f0 xref lseek(2) instead of seek(2); PR lib/2750
also note fpos_t/off_t discrepancy.
1997-01-23 08:10:04 +00:00
perry
49f0a0ae54 fix pr-2664, second param to fgets is int not size_t, from SAITOH Masanobu 1997-01-17 02:38:19 +00:00
cgd
316aac5b98 pull in local.h for prototypes. first arg to __sflags() is const char * 1996-12-20 20:26:00 +00:00
mouse
b88c4afb8d Apply PR 2751 - writefn's second arg is const char *, not char *. 1996-11-07 09:23:10 +00:00
explorer
5b3a9aad8d Cute little bug with operator precedence in our stdio code. It appears
that flushing wasn't done right when input buffers were refilled, due
to a check like
	if (foo == _A | _B) which, since _A and _B are both != 0, always
evaluates to true.

Found by proven@cygnus.com
1996-08-13 07:54:00 +00:00
pk
204be49cb4 typo: DV -> Dv 1996-05-05 19:21:20 +00:00
mycroft
0fd4b530e0 Change suggested by Chris Torek to fix problem freopen()ing with a closed
file descriptor.
1996-05-04 19:25:19 +00:00
jtc
da8d0ce8e0 Add explict function return types 1996-03-29 23:29:06 +00:00
jtc
0bcc20d745 Fix typo in funopen prototype; Reported by Noriyuki Soda in PR #1954 1996-01-17 01:42:55 +00:00
jtc
b01f461032 Remove trailing comma from cross reference list. 1995-07-03 22:49:10 +00:00
jtc
615fb07b15 The C Standard says that printf's format string is a multi-byte
character string.  NA1 says that the 99 characters required by the
Standard have representations in the initial state which are one byte
long and do not alter the state.

Thus we can safely break apart the format string with mbtowc() until
we reach a '%' character, and the process format directive characters
one by one.

We really shouldn't be using mbtowc(), rather mbrtowc() (which takes a
mbstate-t argument) but we don't have the NA1 functions implemented
yet.  This is safe, because even when we do we're not likely to
support multi-byte character encodings that use shift states.
1995-05-02 19:52:41 +00:00
jtc
2ef4abe78f change second arg of fgets() from size_t to int 1995-03-25 02:50:04 +00:00
jtc
4255068068 Removed const qualifier from ftell's FILE * argument. It's not ANSI,
and the recent change to flush output causes it to be changed.
1995-03-22 18:17:24 +00:00
jtc
3b29974599 Added "long long" support %ll{d,x,o,i}. 1995-03-22 00:56:55 +00:00
jtc
38937f73d0 flush so that the offset will be correct on streams opened in
append mode (from chris torek).
1995-03-05 06:56:09 +00:00
cgd
3d5508dc07 mktemp.c belongs here, not gen/Makefile.inc 1995-02-25 17:06:28 +00:00
cgd
708504beb1 when you have a pointer and want to assign to a quad, you must cast it
to long to quiet the compiler.
1995-02-25 07:06:38 +00:00
cgd
9386b82936 when you have a quad and want to assign to a pointer, you must say:
ptr = (ptr_type)(long)quad;
to quiet the compiler.
1995-02-25 07:02:16 +00:00
jtc
edead1feee revert 1995-02-02 02:16:48 +00:00
jtc
255db7b26b Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
1995-02-02 02:09:03 +00:00
jtc
389c46c57d Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
1995-02-02 01:15:33 +00:00
jtc
7cd7db23c2 imported from 44lite 1995-02-02 00:57:36 +00:00
jtc
6a96a52c80 Handle long doubles.
Like Plauger's implementation in "The Standard C Library", we use strtod(),
which will limit the range of values that can be converter properly if
long double has greater precision or range than double.

We will need a string to long double function to handle this properly, but
this change is better than the previous behavior of ignoring the existance
of long doubles.
1995-01-30 00:45:59 +00:00
jtc
f0c0009971 Added support for quad_t and u_quad_t's with the 'q' flag. 1995-01-27 15:20:25 +00:00
jtc
2893ea1742 Removed conflicting "backwards compatibility" code to make scanf
ANSI compliant.
1995-01-26 01:34:44 +00:00
jtc
a40e8f9215 Fixed bug with '+' or ' ' flags and precision.
for example, printf("% 6.4d\n", 77) output one two many padding chars.
1995-01-25 11:20:41 +00:00
mycroft
33c7f89b0e Remove useless invocation of the evil getdtablesize(3). 1994-12-30 04:40:13 +00:00
cgd
ae9172d6cd specify man pages the new way. 1994-12-22 09:57:51 +00:00
cgd
fee4815efc fix pr 594, pointed out by Chuck Silvers. fix taken from 4.4-Lite, rather
than his patch.  (functionally identical, though...)
1994-12-08 22:58:47 +00:00
jtc
14c8a82a15 Fix zero padding when using the # format modifier. 1994-10-20 03:56:56 +00:00
cgd
4d09105f58 needs string.h 1994-10-19 03:18:47 +00:00
jtc
e19f10c79b Change size of array passed to __strerror() from 128 to NL_TEXTMAX. 1994-10-06 18:14:53 +00:00
jtc
c36fd69bc3 The decimal point character is locale specific. 1994-09-30 02:39:13 +00:00
mycroft
e9d5734eb6 Move FLOATING_POINT definition into Makefile.inc. 1994-09-19 04:43:02 +00:00
jtc
0d6ff3aeed Increased the size of char buffer used by perror(); the error strings may
be much longer in some locales.
1994-09-03 05:20:00 +00:00
jtc
c7527f8b84 Converted to use link-time warning messages. 1994-07-21 17:13:35 +00:00
cgd
26fc33ba8d _VA_LIST_ -> _BSD_VA_LIST_ 1994-05-22 23:14:07 +00:00
jtc
d44d58bfcc Fix typo, from Giles Lean (Fixes bug #248) 1994-05-16 20:15:04 +00:00
mycroft
d3972d5149 Get rid of extra calls to strlen(). 1994-04-24 01:05:13 +00:00
mycroft
409eebd101 Print the name of the program using a deprecated function. 1994-04-24 01:01:29 +00:00
cgd
769ce7c7ee fgetln, not fgetline 1994-04-03 01:38:27 +00:00
cgd
1d2110a409 be reasonable and unique. 1994-03-29 10:46:37 +00:00
jtc
719a8083f0 Fix spelling errors. 1994-01-11 00:05:54 +00:00
cgd
f45b975fa5 rename fgetline() 1994-01-04 05:36:22 +00:00
cgd
02254e0c37 rename fgetline() and sharpen axe for bostic... 1994-01-04 05:16:44 +00:00
mycroft
4fdb06a4f5 Clean up deleted files. 1994-01-04 05:13:19 +00:00
cgd
a18790e65d rename fgetline() and sharpen axe for bostic... 1994-01-04 05:13:16 +00:00
jtc
58f143a599 Add explicit return types to function definitions. 1993-12-31 19:13:47 +00:00
jtc
b64dadb1ac #include <string.h> to bring function prototypes into scope. 1993-12-28 19:45:46 +00:00
cgd
6039a60bb3 don't squish newline at end of fgetline()... from bostic 1993-12-22 07:10:58 +00:00
jtc
b30024a6da Change from Chris Torek (via comp.std.c) to make fread() ANSI compliant. 1993-12-14 23:17:09 +00:00
jtc
17585e0f6d Manpage formatting tweaks. 1993-12-01 18:49:52 +00:00
jtc
ed9ab81fcc Use ".Va" macro when formatting "errno". 1993-11-30 21:52:46 +00:00
jtc
a66bb8995a Use "Er" for argument to -width in the lists in the ERROR sections so that
formatting is consistant.
1993-11-29 22:06:07 +00:00
cgd
527838aa9a yet another setvbuf fix from torek... 1993-11-17 08:18:39 +00:00
jtc
a054c6582a First pass at getting a clean compile with "gcc -Wall", mostly explictly
declaring function return values, etc.
1993-11-11 19:04:04 +00:00
jtc
86f54a1e24 Corrected and simplified floating point formatting.
Now conforms to ANSI C --- passes the fairly rigorous TCL "format.test".
1993-11-04 02:26:10 +00:00
jtc
5be26afce6 Trailing zeros should be printed with all floating point formats
except %g && %G --- ANSI X3.159-1989, Sect 7.9.6.1.
1993-11-03 19:32:01 +00:00
cgd
c8c15b1c4c don't compiler strerror.c source here, and clean up. 1993-10-18 20:24:34 +00:00
jtc
845bf7e773 Helper function _strerror is in the user's namespace, renamed it to
__strerror().
1993-10-09 00:11:01 +00:00
mycroft
b50f401d64 Clean up deleted files. 1993-10-07 19:28:50 +00:00
jtc
473c152a0a Moved strerror.[c3] from libc/stdio to libc/string.
Since perror is not permitted to change strerror()'s static buffer, I have
changed both functions to pass their own buffers to the new library-internal
function _strerror() that actually does the error message string look up.
Split strerror manpage into strerror and perror manpages.
1993-10-07 19:27:50 +00:00
jtc
3cdce553b8 Fix typo from last change. 1993-10-05 23:28:09 +00:00
cgd
757cce049d make the first param const char *, so it compiles... 1993-10-05 21:06:04 +00:00
jtc
edbd9128da Changed SYNOPSIS, #include <string.h> before using strerror(). 1993-10-05 16:56:45 +00:00
jtc
75e26868bb fread and fwrite both return size_t, not int. 1993-10-04 18:50:23 +00:00
jtc
238aebd684 Note that fileno() conforms to 1003.1-90. 1993-10-04 18:23:09 +00:00
jtc
9c20f740a3 Declare rcsid strings so they are stored in text segment. 1993-08-26 00:43:03 +00:00
cgd
f08e3f34a5 merge in changes from netbsd-0-9-ALPHA2 1993-08-07 07:42:13 +00:00
mycroft
52efca41cd Nuke remaining patchkit headers. 1993-08-02 18:17:24 +00:00
mycroft
e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
mycroft
b1bd4afedc Add RCS indentifiers. 1993-08-01 07:42:49 +00:00
mycroft
cda4f8f6ee Add RCS identifiers. 1993-08-01 05:37:30 +00:00
mycroft
b7c7310653 Make declarations match prototypes. 1993-07-12 02:09:31 +00:00
cgd
49693da854 update for better FP routines, from AT&T & elsewhere 1993-07-09 09:40:07 +00:00
cgd
27c2936367 apply fix to setvbuf(), supplied by chris torek 1993-05-24 07:19:35 +00:00
cgd
e9fa4a0d6e update with new files from Chris Torek 1993-05-07 07:40:27 +00:00
mycroft
1b67cec37d Fix various bugs in man pages (from 386BSD patch 130). 1993-04-22 03:27:28 +00:00
mycroft
78ff981673 Fix error in last patch. 1993-04-18 09:21:15 +00:00
mycroft
f6eb9a54d8 Make arguments match prototypes. 1993-04-18 09:19:56 +00:00
cgd
3201bdaf64 fixed problem with 2 `/' chars back to back in temp files, which kills emacs 1993-04-02 12:31:56 +00:00
cgd
e541169ce2 after 0.2.2 "stable" patches applied 1993-03-21 18:04:42 +00:00
cgd
61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00