projects
/
libs
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85ef592
)
Produce an octal escape code for \177
master
author
Mikko Rasa
<tdb@tdb.fi>
Sun, 2 Jan 2022 10:13:04 +0000
(12:13 +0200)
committer
Mikko Rasa
<tdb@tdb.fi>
Sun, 2 Jan 2022 10:13:04 +0000
(12:13 +0200)
This character is designated DEL and should be considered non-printable.
source/strings/utils.cpp
patch
|
blob
|
history
diff --git
a/source/strings/utils.cpp
b/source/strings/utils.cpp
index eb2142d5be153b68c405a26a96dba0856f3e4091..748d717464690851585e22f9ccdc45da5885eabc 100644
(file)
--- a/
source/strings/utils.cpp
+++ b/
source/strings/utils.cpp
@@
-258,7
+258,7
@@
string c_escape(const string &str, bool escape_8bit)
result += "\\\'";
else if(c=='\\')
result += "\\\\";
- else if(static_cast<unsigned char>(c)<' ' || (escape_8bit && (c&0x80)))
+ else if(static_cast<unsigned char>(c)<' ' ||
c==0x7F ||
(escape_8bit && (c&0x80)))
{
char buf[4] = { '\\', 0 };
for(unsigned j=0; j<3; ++j)