diff options
author | David Walter Seikel | 2014-05-15 14:25:30 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-15 14:25:30 +1000 |
commit | e10078a5ae9b7d80cd56f547b4b8ce2f14abbc88 (patch) | |
tree | a5a7123321c60320f029d6eb8b949c60b9eac5ff /src | |
parent | Properly fix list concatenation, I hope. (diff) | |
download | SledjHamr-e10078a5ae9b7d80cd56f547b4b8ce2f14abbc88.zip SledjHamr-e10078a5ae9b7d80cd56f547b4b8ce2f14abbc88.tar.gz SledjHamr-e10078a5ae9b7d80cd56f547b4b8ce2f14abbc88.tar.bz2 SledjHamr-e10078a5ae9b7d80cd56f547b4b8ce2f14abbc88.tar.xz |
Escape notecard lines.
Diffstat (limited to 'src')
-rw-r--r-- | src/love/love.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/love/love.c b/src/love/love.c index c3f1e3e..5553670 100644 --- a/src/love/love.c +++ b/src/love/love.c | |||
@@ -435,7 +435,19 @@ static Eina_Bool _dataLuaSL(void *data, int type, Ecore_Con_Event_Server_Data *e | |||
435 | { | 435 | { |
436 | if (temp) | 436 | if (temp) |
437 | { | 437 | { |
438 | sendForth(ourGlobals->serverLuaSL, me->SID, "events.dataserver(\"%s\", \"%s\")", key, temp); | 438 | char buf2[PATH_MAX]; |
439 | int i, j, len = strlen(temp); | ||
440 | |||
441 | // Escape ' and \ characters. | ||
442 | for (i = 0, j = 0; i <= len; i++) | ||
443 | { | ||
444 | if ('\'' == temp[i]) | ||
445 | buf2[j++] = '\\'; | ||
446 | if ('\\' == temp[i]) | ||
447 | buf2[j++] = '\\'; | ||
448 | buf2[j++] = temp[i]; | ||
449 | } | ||
450 | sendForth(ourGlobals->serverLuaSL, me->SID, "events.dataserver(\"%s\", '%s')", key, buf2); | ||
439 | } | 451 | } |
440 | else | 452 | else |
441 | sendForth(ourGlobals->serverLuaSL, me->SID, "events.dataserver(\"%s\", \"EndOfFuckingAround\")", key); | 453 | sendForth(ourGlobals->serverLuaSL, me->SID, "events.dataserver(\"%s\", \"EndOfFuckingAround\")", key); |