Fix for bug #70.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 25 Mar 2003 15:54:46 +0000 (15:54 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 25 Mar 2003 15:54:46 +0000 (15:54 +0000)
I am a little skeptical about this patch, because somehow
the file had the TXT_ISEXT flag set in it, and the support for
that feature isn't complete. What I want to know is how that
flag got set in the first place, none of the interface code
turns it on.

At least it fixes the crash.

source/blender/blenloader/intern/readfile.c

index 07d7c7fcc5a6e31773b0e8d7d22502f3dc288b94..b87b4d1169587100f10f0140f8550fb6ddcfc799 100644 (file)
@@ -1661,33 +1661,31 @@ static void direct_link_text(FileData *fd, Text *text)
        
        text->compiled= NULL;
                
+/*
        if(text->flags & TXT_ISEXT) {
-               /* not implemented yet... */
-               /* reopen_text(text); */
+               reopen_text(text);
        } else {
+*/
 
-               if(text->lines.first==0) return;
-       
-               link_list(fd, &text->lines);
-       
-               text->curl= newdataadr(fd, text->curl);
-               text->sell= newdataadr(fd, text->sell);
-       
-               ln= text->lines.first;
-               while(ln) {
-                       ln->line= newdataadr(fd, ln->line);
-       
-                       if (ln->len != (int) strlen(ln->line)) {
-                               printf("Error loading text, line lengths differ\n");
-                               ln->len = strlen(ln->line);
-                       }
-       
-                       ln= ln->next;
+       link_list(fd, &text->lines);
+
+       text->curl= newdataadr(fd, text->curl);
+       text->sell= newdataadr(fd, text->sell);
+
+       ln= text->lines.first;
+       while(ln) {
+               ln->line= newdataadr(fd, ln->line);
+
+               if (ln->len != (int) strlen(ln->line)) {
+                       printf("Error loading text, line lengths differ\n");
+                       ln->len = strlen(ln->line);
                }
-                       
-               text->flags |= TXT_ISTMP;
+
+               ln= ln->next;
        }
-       
+
+       text->flags = (text->flags|TXT_ISTMP) & ~TXT_ISEXT;
+
        text->id.us= 1;
 }