diff options
author | Paul A. Patience <paul@apatience.com> | 2021-08-28 11:22:07 -0400 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-08-28 08:57:51 -0700 |
commit | 4088dec1dfd66df9c26acdb64cd4a7ae0c2bbfb9 (patch) | |
tree | c8785fd154d05a0b9969eca6ad717a9d2066eb51 | |
parent | 571a1cb6db6a59fab76e95b88738fb7e94a096ae (diff) | |
download | txr-4088dec1dfd66df9c26acdb64cd4a7ae0c2bbfb9.tar.gz txr-4088dec1dfd66df9c26acdb64cd4a7ae0c2bbfb9.tar.bz2 txr-4088dec1dfd66df9c26acdb64cd4a7ae0c2bbfb9.zip |
open-file: fix broken "+" mode string.
The "+" mode string should be equivalent to "r+", according to
the manual, but before this change it was equivalent to "r".
* stream.c (do_parse_mode): Unconditionally set m.write to 1
when "+" is present in the mode string.
-rw-r--r-- | stream.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1471,9 +1471,8 @@ static struct stdio_mode do_parse_mode(val mode_str, struct stdio_mode m_dfl, if (*ms == '+') { ms++; - if (m.read) - m.write = 1; m.read = 1; + m.write = 1; } if (!m.read && !m.write) |