# HG changeset patch # User lost # Date 1232686381 0 # Node ID 87c4e65074f0ec7d157892386782b64d36552434 # Parent be1abc4ac114f7500991c063f5802bc7d2360886 Actually allow script file to be specified and fix segfault on parsing script file diff -r be1abc4ac114 -r 87c4e65074f0 src/main.c --- a/src/main.c Fri Jan 23 04:03:37 2009 +0000 +++ b/src/main.c Fri Jan 23 04:53:01 2009 +0000 @@ -106,7 +106,7 @@ "Generate DECB .bin format output, equivalent of --format=decb"}, { "raw", 'r', 0, 0, "Generate raw binary format output, equivalent of --format=raw"}, - { "script", 's', 0, 0, + { "script", 's', "FILE", 0, "Specify the linking script (overrides the build in defaults)"}, { 0 } }; diff -r be1abc4ac114 -r 87c4e65074f0 src/script.c --- a/src/script.c Fri Jan 23 04:03:37 2009 +0000 +++ b/src/script.c Fri Jan 23 04:53:01 2009 +0000 @@ -60,7 +60,7 @@ void setup_script() { - char *script; + char *script, *oscript; long size; // read the file if needed @@ -115,6 +115,7 @@ size = strlen(script); } + oscript = script; // now parse the script file while (*script) { @@ -252,5 +253,5 @@ } if (scriptfile) - lw_free(script); + lw_free(oscript); }