mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
parent
647d5722aa
commit
af14376c84
@ -512,8 +512,9 @@ bool expand_arg(char* argex, const char* arg, u32 len) {
|
|||||||
u32 out_len = out - argex;
|
u32 out_len = out - argex;
|
||||||
if (out_len >= (_ARG_MAX_LEN-1)) return false; // maximum arglen reached
|
if (out_len >= (_ARG_MAX_LEN-1)) return false; // maximum arglen reached
|
||||||
|
|
||||||
if (*in == '\\') { // escape line breaks
|
if (*in == '\\') { // escape line breaks & quotes
|
||||||
if (*(++in) == 'n') *(out++) = '\n';
|
if (*(++in) == 'n') *(out++) = '\n';
|
||||||
|
else if (*in == '\"') *(out++) = '\"';
|
||||||
else {
|
else {
|
||||||
*(out++) = '\\';
|
*(out++) = '\\';
|
||||||
*(out++) = *in;
|
*(out++) = *in;
|
||||||
@ -597,7 +598,7 @@ char* get_string(char* ptr, const char* line_end, u32* len, char** next, char* e
|
|||||||
// handle string
|
// handle string
|
||||||
if (*ptr == '\"') { // quotes
|
if (*ptr == '\"') { // quotes
|
||||||
str = ++ptr;
|
str = ++ptr;
|
||||||
for (; (*ptr != '\"') && (ptr < line_end); ptr++, (*len)++);
|
for (; ((*ptr != '\"') || (*(ptr-1) == '\\')) && (ptr < line_end); ptr++, (*len)++);
|
||||||
if (ptr >= line_end) { // failed if unresolved quotes
|
if (ptr >= line_end) { // failed if unresolved quotes
|
||||||
if (err_str) snprintf(err_str, _ERR_STR_LEN, "unresolved quotes");
|
if (err_str) snprintf(err_str, _ERR_STR_LEN, "unresolved quotes");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user