diff options
| -rw-r--r-- | lobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.c,v 2.1 2003/12/10 12:13:36 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.2 2004/04/30 20:13:38 roberto Exp roberto $ |
| 3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -173,7 +173,7 @@ void luaO_chunkid (char *out, const char *source, int bufflen) { | |||
| 173 | strcat(out, source); | 173 | strcat(out, source); |
| 174 | } | 174 | } |
| 175 | else { /* out = [string "string"] */ | 175 | else { /* out = [string "string"] */ |
| 176 | int len = strcspn(source, "\n"); /* stop at first newline */ | 176 | int len = strcspn(source, "\n\r"); /* stop at first newline */ |
| 177 | bufflen -= sizeof(" [string \"...\"] "); | 177 | bufflen -= sizeof(" [string \"...\"] "); |
| 178 | if (len > bufflen) len = bufflen; | 178 | if (len > bufflen) len = bufflen; |
| 179 | strcpy(out, "[string \""); | 179 | strcpy(out, "[string \""); |
