# HG changeset patch # User lost # Date 1232686381 0 # Node ID f9bfc2986023fca36b99730fe5dbd858338979f2 # Parent 4ac96c697ef0886d2fe9cef06f7b7fbf1119d786 Actually allow script file to be specified and fix segfault on parsing script file diff -r 4ac96c697ef0 -r f9bfc2986023 lwlink/trunk/src/main.c --- a/lwlink/trunk/src/main.c Fri Jan 23 04:03:37 2009 +0000 +++ b/lwlink/trunk/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 4ac96c697ef0 -r f9bfc2986023 lwlink/trunk/src/script.c --- a/lwlink/trunk/src/script.c Fri Jan 23 04:03:37 2009 +0000 +++ b/lwlink/trunk/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); }