diff options
Diffstat (limited to 'compiler/utils/msg2inc.pp')
-rw-r--r-- | compiler/utils/msg2inc.pp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/compiler/utils/msg2inc.pp b/compiler/utils/msg2inc.pp index 905d530952..12c82875f9 100644 --- a/compiler/utils/msg2inc.pp +++ b/compiler/utils/msg2inc.pp @@ -612,15 +612,21 @@ Var begin hs:=''; for i:=1 to length(s) do - if (S[i]='$') then - begin - if (s[i+1] in ['0'..'9']) then - hs:=hs+'arg' - else - hs:=hs+'\$'; - end + case S[i] of + '$' : + if (s[i+1] in ['0'..'9']) then + hs:=hs+'arg' + else + hs:=hs+'\$'; + '&','{','}','#','_','%': // Escape these characters + hs := hs + '\' + S[i]; + '~','^': + hs := hs + '\'+S[i]+' '; + '\': + hs:=hs+'$\backslash$' else - hs:=hs+s[i]; + hs := hs + S[i]; + end; EscapeString:=hs; end; |