OSDN Git Service

行番号の表示に伴う改行コード CR only の未サポート
authornaruko <naruko@24ea1065-a21e-4ca1-99c9-f5125deb0858>
Sat, 17 Jan 2009 23:19:07 +0000 (23:19 +0000)
committernaruko <naruko@24ea1065-a21e-4ca1-99c9-f5125deb0858>
Sat, 17 Jan 2009 23:19:07 +0000 (23:19 +0000)
git-svn-id: svn+ssh://svn.osdn.net/svnroot/unagi@269 24ea1065-a21e-4ca1-99c9-f5125deb0858

client/trunk/script.c
client/trunk/textutil.c

index 90714a7..dfe0a05 100644 (file)
@@ -360,7 +360,7 @@ static int syntax_check_phase(char **word, int word_num, struct script *s, const
                syntax++;
                i--;
        }
-       printf("%s unknown opcode %s\n", SYNTAX_ERROR_PREFIX, opword);
+       printf("%d:%s unknown opcode %s\n", s->line, SYNTAX_ERROR_PREFIX, opword);
        return 1;
 }
 
index 21e4b34..86e8a5d 100644 (file)
@@ -20,12 +20,16 @@ int text_load(char *buf, int length, char **text)
        text[line] = buf;
        line++;
        while(length != 0){
-               int current_crlf = 0;
+               //Àµ³Î¤Ê¹Ô¿ôÇÄ°®¤È¼êÈ´¤­¤Î¤¿¤á CR only ¤Î²þ¹Ô¥³¡¼¥É¤ò̤¥µ¥Ý¡¼¥È¤È¤¹¤ë
+               int current_lf = 0;
+               
                switch(*buf){
                case '\n':
+                       *buf = '\0';
+                       current_lf = 1;
+                       break;
                case '\r':
                        *buf = '\0';
-                       current_crlf = 1;
                        break;
                }
                switch(pastdata){
@@ -34,7 +38,7 @@ int text_load(char *buf, int length, char **text)
                                PRINT("line over")
                                return 0;
                        }
-                       if(current_crlf == 0){
+                       if(current_lf == 0){
                                text[line] = buf;
                                line++;
                        }