Remove unnecessary prefix char in escaping

We can encode it at higher level.
This commit is contained in:
Andrea Mazzoleni 2016-05-29 18:23:43 +02:00
parent 256db0e595
commit dd87022490
5 changed files with 14 additions and 22 deletions

View file

@ -430,7 +430,7 @@ bail:
/* LCOV_EXCL_STOP */
}
const char* esc_shell(char prefix, const char* str, char* buffer)
const char* esc_shell(const char* str, char* buffer)
{
char* begin = buffer;
char* end = begin + ESC_MAX;
@ -446,13 +446,6 @@ const char* esc_shell(char prefix, const char* str, char* buffer)
}
#endif
/* add the prefix char, if any */
if (prefix) {
if (p == end)
goto bail;
*p++ = prefix;
}
/* copy string with escaping */
while (*str) {
char c = *str;