Browse Source

* fixed crash with empty codepage

git-svn-id: trunk@234 -
peter 20 năm trước cách đây
mục cha
commit
edffc31139
1 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 2 3
      compiler/charset.pas

+ 2 - 3
compiler/charset.pas

@@ -176,11 +176,11 @@ unit charset;
          hp : punicodemap;
 
       const
-         mapcache : string = '';
          mapcachep : punicodemap = nil;
 
       begin
-         if (mapcache=s) and (mapcachep^.cpname=s) then
+         if assigned(mapcachep) and
+            (mapcachep^.cpname=s) then
            begin
               getmap:=mapcachep;
               exit;
@@ -191,7 +191,6 @@ unit charset;
               if hp^.cpname=s then
                 begin
                    getmap:=hp;
-                   mapcache:=s;
                    mapcachep:=hp;
                    exit;
                 end;