summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-06-25 00:26:19 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-06-25 00:26:19 +0000
commitc8fb78fd446be6c38a32ac9e87af48ab7f8cb300 (patch)
tree9fee263c1ea7219db3069d4c197abc1d5ecd73c9 /apps
parent29f62ebf845dab47474fd9b8b86a71b6066f4db4 (diff)
Made the sokoban level loader CR/LF tolerant
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3758 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/recorder/sokoban.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/recorder/sokoban.c b/apps/recorder/sokoban.c
index faf868044c..5e4148c2e1 100644
--- a/apps/recorder/sokoban.c
+++ b/apps/recorder/sokoban.c
@@ -329,7 +329,7 @@ static int get_level(char *level, int level_size)
/* we search for the first character that isn't a newline */
for (i = 0; i < nread; i++) {
/* skip and count all newlines */
- while((buffer[i] == '\n') && (i < nread)) {
+ while((buffer[i] == '\n' || buffer[i] == '\r') && (i < nread)) {
prevnewl++;
i++;
}
@@ -339,7 +339,7 @@ static int get_level(char *level, int level_size)
break;
/* start of new level? */
- if((prevnewl>1) && (buffer[i] != '\n')) {
+ if((prevnewl>1) && (buffer[i] != '\n' && buffer[i] != '\r')) {
prevnewl=0; /* none now */
level_ct++;
@@ -351,7 +351,7 @@ static int get_level(char *level, int level_size)
}
/* skip all non-newlines */
- while((buffer[i] != '\n') && (i < nread))
+ while((buffer[i] != '\n' && buffer[i] != '\r') && (i < nread))
i++;
}
if(!level_found)