summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-01-16 18:32:08 +0000
committerKarl Berry <karl@freefriends.org>2024-01-16 18:32:08 +0000
commit84b532c711d3e644d6ba05e8118356310fd68fbf (patch)
tree33d34c031bb6342b29a3801d2cc1f9208f637920 /Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp
parent32d816973b284f3e5a0bd28a7ad5ef73e3102b34 (diff)
dvisvgm 3.2
git-svn-id: svn://tug.org/texlive/trunk@69453 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp
index c79f6e95267..3281396f3a8 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp
@@ -2,7 +2,7 @@
** Process.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2023 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2024 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -74,13 +74,13 @@ string Subprocess::read (const SearchPattern &pattern, bool *error) {
const size_t bytesRead = readFromPipe(&_rdbuf[_bufstartpos], _rdbuf.size()-_bufstartpos, error);
const size_t bufendpos = _bufstartpos + bytesRead;
smatch matches;
- size_t matchendpos= bufendpos; // buffer position after last match
+ size_t matchendpos = bufendpos; // buffer position after last match
if (pattern.search.empty())
result.assign(_rdbuf.data(), matchendpos);
else {
bool matched=false;
regex re(pattern.search);
- for (auto it = cregex_iterator(&_rdbuf[0], &_rdbuf[bufendpos], re); it != cregex_iterator(); ++it) {
+ for (auto it = cregex_iterator(&_rdbuf[0], &_rdbuf[0]+bufendpos, re); it != cregex_iterator(); ++it) {
result += it->format(pattern.replace, regex_constants::format_no_copy);
matchendpos = it->position() + it->length();
matched = true;
@@ -121,11 +121,8 @@ bool Process::run (string *out, const SearchPattern &pattern, PipeFlags flags) {
if (out)
out->clear();
for (;;) {
- if (out) {
- string chunk;
- subprocess.readFromPipe(chunk, pattern);
- *out += chunk;
- }
+ if (out)
+ subprocess.readFromPipe(*out, pattern);
Subprocess::State state = subprocess.state();
if (state != Subprocess::State::RUNNING)
return state == Subprocess::State::FINISHED;