diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-09 17:35:23 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-09 17:35:23 -0200 |
commit | 73be918285f7e2eb0acc02d73effa6a95a8ab08c (patch) | |
tree | 531ca3af5cd96cae92eaf3750990f63b06727588 /iolib.c | |
parent | ca412214cbbeb8f40e9abea534e6171044cc0a57 (diff) | |
download | lua-73be918285f7e2eb0acc02d73effa6a95a8ab08c.tar.gz lua-73be918285f7e2eb0acc02d73effa6a95a8ab08c.tar.bz2 lua-73be918285f7e2eb0acc02d73effa6a95a8ab08c.zip |
a backslash followed by a newline allows the newline to go into
a string.
Diffstat (limited to 'iolib.c')
-rw-r--r-- | iolib.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** Input/output library to LUA | 3 | ** Input/output library to LUA |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_iolib="$Id: iolib.c,v 1.33 1996/02/05 21:32:19 roberto Exp roberto $"; | 6 | char *rcs_iolib="$Id: iolib.c,v 1.34 1996/02/09 19:02:30 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | #include <ctype.h> | 9 | #include <ctype.h> |
@@ -380,14 +380,10 @@ static int write_quoted (int just, int m) | |||
380 | { | 380 | { |
381 | switch (*s) | 381 | switch (*s) |
382 | { | 382 | { |
383 | case '"': case '\\': | 383 | case '"': case '\\': case '\n': |
384 | luaI_addchar('\\'); | 384 | luaI_addchar('\\'); |
385 | luaI_addchar(*s); | 385 | luaI_addchar(*s); |
386 | break; | 386 | break; |
387 | case '\n': | ||
388 | luaI_addchar('\\'); | ||
389 | luaI_addchar('n'); | ||
390 | break; | ||
391 | case 0: | 387 | case 0: |
392 | goto END_WHILE; | 388 | goto END_WHILE; |
393 | default: | 389 | default: |