diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-09-23 11:37:14 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-09-23 23:26:58 +0200 |
commit | ffa57164a84462e33912d359bcf11f8debb1c7d8 (patch) | |
tree | ed824609580d9f84aab6b7586d13c998203fcff2 /main | |
parent | 5783e611a2155ba719bc7a9f6b26a834ce78cb22 (diff) | |
download | php-git-ffa57164a84462e33912d359bcf11f8debb1c7d8.tar.gz |
Clear error flag instead of toggling it
The toggling of the `REPORT_ERRORS` looks fishy, and likely was
intented as clearing.
Closes GH-6190.
Diffstat (limited to 'main')
-rw-r--r-- | main/streams/streams.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c index b14c6fa396..1262c874f7 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -2038,7 +2038,7 @@ PHPAPI php_stream *_php_stream_opendir(const char *path, int options, if (wrapper && wrapper->wops->dir_opener) { stream = wrapper->wops->dir_opener(wrapper, - path_to_open, "r", options ^ REPORT_ERRORS, NULL, + path_to_open, "r", options & ~REPORT_ERRORS, NULL, context STREAMS_REL_CC); if (stream) { @@ -2046,7 +2046,7 @@ PHPAPI php_stream *_php_stream_opendir(const char *path, int options, stream->flags |= PHP_STREAM_FLAG_NO_BUFFER | PHP_STREAM_FLAG_IS_DIR; } } else if (wrapper) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, "not implemented"); + php_stream_wrapper_log_error(wrapper, options & ~REPORT_ERRORS, "not implemented"); } if (stream == NULL && (options & REPORT_ERRORS)) { php_stream_display_wrapper_errors(wrapper, path, "Failed to open directory"); @@ -2115,18 +2115,18 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod if (wrapper) { if (!wrapper->wops->stream_opener) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, + php_stream_wrapper_log_error(wrapper, options & ~REPORT_ERRORS, "wrapper does not support stream open"); } else { stream = wrapper->wops->stream_opener(wrapper, - path_to_open, mode, options ^ REPORT_ERRORS, + path_to_open, mode, options & ~REPORT_ERRORS, opened_path, context STREAMS_REL_CC); } /* if the caller asked for a persistent stream but the wrapper did not * return one, force an error here */ if (stream && (options & STREAM_OPEN_PERSISTENT) && !stream->is_persistent) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, + php_stream_wrapper_log_error(wrapper, options & ~REPORT_ERRORS, "wrapper does not support persistent streams"); php_stream_close(stream); stream = NULL; @@ -2183,7 +2183,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod tmp); efree(tmp); - options ^= REPORT_ERRORS; + options &= ~REPORT_ERRORS; } } } |