summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-09-06 19:33:39 -0400
committerGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-09-06 19:33:39 -0400
commit18cbb7d5217f9ed51ade3ac30d18930b80496bb7 (patch)
tree3ae922e1cf463939c5ee199eec0a863b159a49fe /src
parent052b070a854c9ac8648d976f18c4b92729244a21 (diff)
src2html: substr doesn't modify std::string, but erase does (nw)
Diffstat (limited to 'src')
-rw-r--r--src/tools/src2html.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/src2html.cpp b/src/tools/src2html.cpp
index b6db0879057..32a21de065e 100644
--- a/src/tools/src2html.cpp
+++ b/src/tools/src2html.cpp
@@ -297,8 +297,8 @@ int main(int argc, char *argv[])
fprintf(stderr, "Template is missing a <!--CONTENT--> marker\n");
return 1;
}
- tempfooter.assign(tempheader).substr(result + 14, -1);
- tempheader.substr(0, result);
+ tempfooter.assign(tempheader).erase(0, result + 14);
+ tempheader.erase(result);
// recurse over subdirectories
return recurse_dir(srcdir.length(), dstdir.length(), srcdir, dstdir, tempheader, tempfooter);
@@ -849,7 +849,7 @@ static bool find_include_file(std::string &srcincpath, int srcrootlen, int dstro
{
sepindex = srcincpath.find_last_of(PATH_SEPARATOR[0]);
if (sepindex != -1)
- srcincpath.substr(0, sepindex);
+ srcincpath.erase(sepindex);
}
// otherwise, append a path separator and the pathpart
@@ -892,7 +892,7 @@ static bool find_include_file(std::string &srcincpath, int srcrootlen, int dstro
// for each directory left in the filename, we need to prepend a "../"
while ((sepindex = tempfile.find_first_of(PATH_SEPARATOR[0])) != -1)
{
- tempfile.substr(sepindex + 1, -1);
+ tempfile.erase(0, sepindex + 1);
srcincpath.insert(0, "../");
}
srcincpath.append(".html");