Mercurial > octave
changeset 29696:cc9bda97ac3f
maint: merge away extra head.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Fri, 21 May 2021 16:15:14 +0200 |
parents | 54c0eb5548ee (current diff) dcb8f78d0f6b (diff) |
children | 3ef50a8d01c5 |
files | |
diffstat | 1 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/gl2ps-print.cc Thu May 20 22:02:05 2021 +0200 +++ b/libinterp/corefcn/gl2ps-print.cc Fri May 21 16:15:14 2021 +0200 @@ -499,15 +499,19 @@ // Remove this "else if" block, and // make header_found true for SVG if gl2ps is fixed. std::string srchstr (str); - std::size_t pos = srchstr.find ("px"); + std::size_t pos = srchstr.find ("<svg "); if (! header_found && pos != std::string::npos) { header_found = true; - srchstr[pos+1] = 't'; // "px" -> "pt" - // Assume the second occurrence is at the same line - pos = srchstr.find ("px", pos); - srchstr[pos+1] = 't'; // "px" -> "pt" - std::strcpy (str, srchstr.c_str ()); + pos = srchstr.find ("px"); + if (pos != std::string::npos) + { + srchstr[pos+1] = 't'; // "px" -> "pt" + // Assume the second occurrence is at the same line + pos = srchstr.find ("px", pos); + srchstr[pos+1] = 't'; // "px" -> "pt" + std::strcpy (str, srchstr.c_str ()); + } } }