X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..6465356a983ac139f81d3b7913cdb548477c346c:/stdio/FreeBSD/flags.c diff --git a/stdio/FreeBSD/flags.c b/stdio/FreeBSD/flags.c index 17d175d..3b90476 100644 --- a/stdio/FreeBSD/flags.c +++ b/stdio/FreeBSD/flags.c @@ -81,10 +81,17 @@ __sflags(mode, optr) } /* [rwa]\+ or [rwa]b\+ means read and write */ - if (*mode == '+' || (*mode == 'b' && mode[1] == '+')) { + if (*mode == 'b') + mode++; + if (*mode == '+') { ret = __SRW; m = O_RDWR; + mode++; + if (*mode == 'b') + mode++; } + if (*mode == 'x') + o |= O_EXCL; *optr = m | o; return (ret); }