diff options
author | Kyungwoo Lee <kyulee@microsoft.com> | 2016-01-07 07:57:55 -0800 |
---|---|---|
committer | Kyungwoo Lee <kyulee@microsoft.com> | 2016-01-07 12:26:27 -0800 |
commit | b59c2745ad1ed8f73cef099ed367d375b26de0dd (patch) | |
tree | b23a2dc8fb839d78c233e5f2292f4eda1a466631 /src/nativeresources | |
parent | d8e21852f1b5be330243154c9da45fcd51d59cc0 (diff) | |
download | coreclr-b59c2745ad1ed8f73cef099ed367d375b26de0dd.tar.gz coreclr-b59c2745ad1ed8f73cef099ed367d375b26de0dd.tar.bz2 coreclr-b59c2745ad1ed8f73cef099ed367d375b26de0dd.zip |
Fix help message in ildasm for Unix
ildasm -h contains a few broken message like "[Undefined resource string ID:0xCC]"
This is because we converted .rc file to a string table and SyntaxCon() enumerate all message ids while some of ids are ifdefedd out under FEATURE_PAL.
The fix is to define all the missing ids with empty string.
And also the indention (prefixed space) are all ignored except one.
Our trick (in awk script) to extract expression ID is to iterate argument string ($i) while setting it
to empty string to effectively delete the argument.
Unfortunately this has side-effect that normalizes all spaces between arguments to one space string.
The fix is to explicitly extract string content from the original string $0.
Diffstat (limited to 'src/nativeresources')
-rw-r--r-- | src/nativeresources/processrc.awk | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nativeresources/processrc.awk b/src/nativeresources/processrc.awk index 1632753956..fcfd6e4f91 100644 --- a/src/nativeresources/processrc.awk +++ b/src/nativeresources/processrc.awk @@ -40,9 +40,9 @@ BEGIN { # some of the resource IDs have trailing L gsub(/L/, "", $i); expression = expression $i; - $i=""; i++; } + # evaluate the resource ID expression cmd = "echo $(("expression"))"; cmd | getline var; @@ -50,13 +50,17 @@ BEGIN { # in case shell returned the result as a string, ensure the var has numeric type var = var + 0; + # Extract string content starting with either " or L" + idx = match($0, /L?\"/); + content = substr($0, idx); + # remove the L prefix from strings - gsub(/L"/, "\"", $0); + gsub(/L"/, "\"", content); # join strings "..." "..." into one - gsub(/" +"/, "", $0); + gsub(/" +"/, "", content); # write the resource entry to the target file - writestringentry(var, $0); + writestringentry(var, content); } } END { |