From 6a6637e3fc5b40d53015a5dab4b44f75ad5da23b Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 10 Dec 2008 18:03:11 +0000 Subject: * Fixed error message file so TeX is ok, and added better escape mechanism git-svn-id: http://svn.freepascal.org/svn/fpc/branches/fixes_2_2@12320 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/msg/errore.msg | 2 +- compiler/utils/msg2inc.pp | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/compiler/msg/errore.msg b/compiler/msg/errore.msg index d6832d1f68..f82f52a0cd 100644 --- a/compiler/msg/errore.msg +++ b/compiler/msg/errore.msg @@ -2441,9 +2441,9 @@ option_confict_asm_debug=11041_W_Assembler output selected "$1" cannot generate option_ppc386_deprecated=11042_W_Use of ppc386.cfg is deprecated, please use fpc.cfg instead % Using ppc386.cfg is still supported for historical reasons, however, for a multiplatform % system the naming makes no sense anymore. Please continue to use fpc.cfg instead. -%\end{description} option_else_without_if=11043_F_In options file $1 at line $2 #ELSE directive without #IF(N)DEF found % An \var{\#ELSE} statement was found in the options file without a matching \var{\#IF(N)DEF} statement. +%\end{description} # EndOfTeX # 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; -- cgit v1.2.1