diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-03-27 17:27:47 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-03-27 17:27:47 +0000 |
commit | f38931a9f060a9ecb2ad544b1c2e2c80060f6724 (patch) | |
tree | dc6eafdd66d5b9869b468c3a01944b291600e72a /libio/fileops.c | |
parent | 528c1f1cb488deb66d80aba839f150450c256c12 (diff) | |
download | glibc-f38931a9f060a9ecb2ad544b1c2e2c80060f6724.zip glibc-f38931a9f060a9ecb2ad544b1c2e2c80060f6724.tar.gz glibc-f38931a9f060a9ecb2ad544b1c2e2c80060f6724.tar.bz2 |
Update.
1998-03-22 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* locales/ru_RU: Abbreviations must end with a consonant. Fix for
Tuesday by Ilya Ovchinnikov <ilya@taspd13a.npi.msu.su>. [PR libc/517]
Diffstat (limited to 'libio/fileops.c')
-rw-r--r-- | libio/fileops.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/libio/fileops.c b/libio/fileops.c index d2377af..d184916 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU IO Library. Written by Per Bothner <bothner@cygnus.com>. @@ -201,9 +201,10 @@ _IO_file_fopen (fp, filename, mode, is32not64) int oflags = 0, omode; int read_write; int oprot = 0666; + int i; if (_IO_file_is_open (fp)) return 0; - switch (*mode++) + switch (*mode) { case 'r': omode = O_RDONLY; @@ -223,11 +224,27 @@ _IO_file_fopen (fp, filename, mode, is32not64) __set_errno (EINVAL); return NULL; } - if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+')) + for (i = 1; i < 4; ++i) { - omode = O_RDWR; - read_write &= _IO_IS_APPENDING; + switch (*++mode) + { + case '\0': + break; + case '+': + omode = O_RDWR; + read_write &= _IO_IS_APPENDING; + continue; + case 'x': + oflags |= O_EXCL; + continue; + case 'b': + default: + /* Ignore. */ + continue; + } + break; } + return _IO_file_open (fp, filename, omode|oflags, oprot, read_write, is32not64); } |