projects
/
awesomized
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
| inline |
side by side
(parent:
491fe2d
)
memcat: VC++ does not understand "?:"
author
Michael Wallner
<mike@php.net>
Mon, 25 Jan 2021 12:57:42 +0000
(13:57 +0100)
committer
Michael Wallner
<mike@php.net>
Mon, 25 Jan 2021 12:57:42 +0000
(13:57 +0100)
src/bin/memcat.cc
patch
|
blob
|
history
diff --git
a/src/bin/memcat.cc
b/src/bin/memcat.cc
index ab8fc6db5ed959649128a35082841f872cda4ac7..1b0f36cac75a61bd60cb0c1dfdde50d12f434068 100644
(file)
--- a/
src/bin/memcat.cc
+++ b/
src/bin/memcat.cc
@@
-96,11
+96,16
@@
int main(int argc, char *argv[]) {
exit(EXIT_FAILURE);
}
+ auto file_flag = opt.isset("file");
+ auto file = opt.argof("file");
auto exit_code = EXIT_SUCCESS;
for (auto arg = argp; *arg; ++arg) {
auto key = *arg;
if (*key) {
- char *file = opt.isset("file") ? (opt.argof("file") ?: key) : nullptr;
+ if (!file && file_flag) {
+ file = key;
+ }
+
std::ofstream fstream{};
std::ostream *ostream = check_ostream(opt, file, fstream);