comparison src/script.c @ 307:87c4e65074f0

Actually allow script file to be specified and fix segfault on parsing script file
author lost
date Fri, 23 Jan 2009 04:53:01 +0000
parents be1abc4ac114
children
comparison
equal deleted inserted replaced
306:be1abc4ac114 307:87c4e65074f0
58 58
59 linkscript_t linkscript = { 0, NULL, -1 }; 59 linkscript_t linkscript = { 0, NULL, -1 };
60 60
61 void setup_script() 61 void setup_script()
62 { 62 {
63 char *script; 63 char *script, *oscript;
64 long size; 64 long size;
65 65
66 // read the file if needed 66 // read the file if needed
67 if (scriptfile) 67 if (scriptfile)
68 { 68 {
113 } 113 }
114 114
115 size = strlen(script); 115 size = strlen(script);
116 } 116 }
117 117
118 oscript = script;
118 // now parse the script file 119 // now parse the script file
119 while (*script) 120 while (*script)
120 { 121 {
121 char *ptr, *ptr2, *line; 122 char *ptr, *ptr2, *line;
122 123
250 } 251 }
251 lw_free(line); 252 lw_free(line);
252 } 253 }
253 254
254 if (scriptfile) 255 if (scriptfile)
255 lw_free(script); 256 lw_free(oscript);
256 } 257 }