瀏覽代碼

Merged revisions 11432,11465,11469-11470,11487-11488,11490,11518-11521,11523,11528,11535,11551,11553,11555,11557,11562,11564,11571,11588,11605,11619,11621-11622,11628,11664-11667,11670,11683,11685,11689-11692,11694-11696,11698,11701-11702,11705-11707,11712-11718,11723-11726,11728-11729,11733-11737,11778,11780-11781,11785,11810,11822-11823,11831,11836,11848,11872,11876-11878,11881-11883,11889,11891-11895,11899-11902,11920-11925,11931-11932,11935,11938,11941,11986,11992,12014,12018,12037 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r11432 | jonas | 2008-07-21 21:37:24 +0200 (Mon, 21 Jul 2008) | 2 lines

+ fpchown() for FPC_USE_LIBC (by Tobias Giesen, mantis #11705)
........
r11605 | jonas | 2008-08-17 19:26:24 +0200 (Sun, 17 Aug 2008) | 3 lines

* "To many colors" -> "Too many colors" (remark by Gerold Veith, mantis
#11909)
........
r11823 | jonas | 2008-09-26 15:28:53 +0200 (Fri, 26 Sep 2008) | 2 lines

* don't "round" 0.0 when converting to a string (mantis #12202)
........
r12037 | jonas | 2008-11-09 10:46:47 +0100 (Sun, 09 Nov 2008) | 3 lines

* fixed setting EInoutError.ErrorCode (mantis #12575, thanks to
Bart Broersma for the analysis)
........

git-svn-id: branches/fixes_2_2@12151 -

joost 17 年之前
父節點
當前提交
8ed06a053b
共有 6 個文件被更改,包括 30 次插入3 次删除
  1. 1 0
      .gitattributes
  2. 1 1
      packages/fcl-image/src/fpwritepng.pp
  3. 2 1
      rtl/inc/real2str.inc
  4. 8 1
      rtl/objpas/sysutils/sysutils.inc
  5. 1 0
      rtl/unix/oscdeclh.inc
  6. 17 0
      tests/webtbs/tw12575.pp

+ 1 - 0
.gitattributes

@@ -8132,6 +8132,7 @@ tests/webtbs/tw1229.pp svneol=native#text/plain
 tests/webtbs/tw1250.pp svneol=native#text/plain
 tests/webtbs/tw1251b.pp svneol=native#text/plain
 tests/webtbs/tw1255.pp svneol=native#text/plain
+tests/webtbs/tw12575.pp svneol=native#text/plain
 tests/webtbs/tw1269.pp svneol=native#text/plain
 tests/webtbs/tw1275.pp svneol=native#text/plain
 tests/webtbs/tw1279.pp svneol=native#text/plain

+ 1 - 1
packages/fcl-image/src/fpwritepng.pp

@@ -412,7 +412,7 @@ begin
         FPalette.Build (TheImage);
         end;
       if ThePalette.count > 256 then
-        raise PNGImageException.Create ('To many colors to use indexed PNG color type');
+        raise PNGImageException.Create ('Too many colors to use indexed PNG color type');
       ColorType := 3;
       FUsetRNS := C > 1;
       BitDepth := 8;

+ 2 - 1
rtl/inc/real2str.inc

@@ -367,7 +367,8 @@ begin
           for fracCount := 1 to currPrec do
             factor := factor * 10.0;
           corrval := corrval / factor;
-          d:=d+roundCorr;
+          if (d<>0.0) then
+            d:=d+roundCorr;
           if d >= corrVal then
             d := d + corrVal;
           if int(d) = 1 then

+ 8 - 1
rtl/objpas/sysutils/sysutils.inc

@@ -282,7 +282,14 @@ begin
        106 : HS:=@SInvalidInput;
      end;
      E:=EinOutError.Create (HS^);
-     EInoutError(E).ErrorCode:=IOresult; // Clears InOutRes !!
+     // this routine can be called from FPC_IOCHECK,
+     // which clears inoutres and then passes its
+     // original value to HandleErrorFrame() (which calls
+     // us). So use errno rather than IOResult, and clear
+     // InOutRes explicitly in case we can also be called
+     // from a place that does not clear InOutRes explicitly
+     EInoutError(E).ErrorCode:=errno;
+     inoutres:=0;
      end;
   // We don't set abstracterrorhandler, but we do it here.
   // Unless the use sets another handler we'll get here anyway...

+ 1 - 0
rtl/unix/oscdeclh.inc

@@ -33,6 +33,7 @@ const
 
     function  FpAccess  (pathname : pchar; amode : cint): cint; cdecl; external clib name 'access';
     function  FpChdir   (path : pchar): cint; cdecl; external clib name 'chdir';
+    Function  FpChown   (path : pChar; owner : TUid; group : TGid): cInt; cdecl; external clib name 'chown';
     function  FpClose   (fd : cint): cint; cdecl; external clib name 'close';
     Function  FpClosedir (var dirp : Dir): cInt; cdecl; external clib name 'closedir';
     function  FpClosedir (dirp : pdir): cint; cdecl; external clib name 'closedir';

+ 17 - 0
tests/webtbs/tw12575.pp

@@ -0,0 +1,17 @@
+{$mode objfpc}
+PROGRAM Test;
+USES SysUtils;
+
+VAR
+  t : Text;
+
+BEGIN
+  Assign(t, 'blah.txt');
+  TRY
+    Close(t);
+  EXCEPT
+    ON e: EInOutError DO
+      if (e.ErrorCode <> 103) then
+        halt(1);
+  END;
+END.