Преглед изворни кода

* Fixed error message file so TeX is ok, and added better escape mechanism

git-svn-id: branches/fixes_2_2@12320 -
michael пре 17 година
родитељ
комит
e4a6b9ab83
2 измењених фајлова са 15 додато и 9 уклоњено
  1. 1 1
      compiler/msg/errore.msg
  2. 14 8
      compiler/utils/msg2inc.pp

+ 1 - 1
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
 
 #

+ 14 - 8
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;