aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-05-03 09:30:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-05-03 09:30:41 -0300
commit1c459b881f0bb579d63eef26acbc2be2110ae3e4 (patch)
tree91e26f3cabd87cffb18588954352280323b8b49f
parent9629508a9859048c43a143e1b8fbb494df7c22a9 (diff)
downloadlua-1c459b881f0bb579d63eef26acbc2be2110ae3e4.tar.gz
lua-1c459b881f0bb579d63eef26acbc2be2110ae3e4.tar.bz2
lua-1c459b881f0bb579d63eef26acbc2be2110ae3e4.zip
accept `\r' as newline when looking for line end
-rw-r--r--lobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lobject.c b/lobject.c
index 27e9b03a..04ad92c4 100644
--- a/lobject.c
+++ b/lobject.c
@@ -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 \"");