)]}'
{
  "commit": "6d91c946651a384d19b7d8fc69ba8d3df3ab3e4b",
  "tree": "9540fbf4b2c1858817281e543fb093d97d13079d",
  "parents": [
    "6263a2fced11f5834975c9af5001adc9161bf5bf"
  ],
  "author": {
    "name": "Pali Rohár",
    "email": "pali.rohar@gmail.com",
    "time": "Sat Dec 13 22:02:47 2025 +0100"
  },
  "committer": {
    "name": "LIU Hao",
    "email": "lh_mouse@126.com",
    "time": "Mon Apr 06 17:51:21 2026 +0800"
  },
  "message": "crt: Fix mingw-w64 stat implementation\n\nMS CRT _stat() implementation is known to be broken in different cases.\nmingw-w64 already contains fixup code for path processing, but this is not\nenough. For example _stat() returns incorrect type for Windows devices\n(like NUL) and rejects \\\\?\\ paths with ENOENT error. This is probably because\nWinAPI FindFirstFile function (which is in lot of times used as replacement\nfor POSIX stat) does not return file type at all.\n\nmingw-w64 already provides working fstat() implementation (as wrapper\naround MS CRT _fstat()) which can be used as stat() fallback for already\nopened file handle.\n\nSo if the MS CRT _stat() fails or returns that file type is regular file\nthen try to open path in read-only mode and call mingw-w64 fstat() on it.\n\nNote that opening path can fail for many reasons (for example denied by\nACL, denied by shared reservation or denied by delete_pending state) while\nregular FindFirstFile is working fine. So do not take errors from opening\npath as fatal error. Use the fstat just for correcting information returned\nby MS CRT _stat() function.\n\nBug: https://sourceforge.net/p/mingw-w64/bugs/1009/\nBug: https://github.com/mingw-w64/mingw-w64/issues/139\nCo-authored-by: LIU Hao \u003clh_mouse@126.com\u003e\nSigned-off-by: LIU Hao \u003clh_mouse@126.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "57d16a83a8c2866f3a3def6544787a6789923781",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/Makefile.am",
      "new_id": "1d85c9db3e434acd8a85e67ac45376ace9463e80",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/Makefile.am"
    },
    {
      "type": "modify",
      "old_id": "13e4bf6d44039cda504a45f008ceab16e36d62b7",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/__mingw_fix_stat.h",
      "new_id": "438182913f73dbbc7cd54724a779b64feadf9963",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/__mingw_fix_stat.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b8a6e4450e79623e07413a248557758296c8871d",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/__mingw_fix_stat_fallback_fd.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1182ab55855d09e73c019dab7f647e395d23a0a6",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/__mingw_fix_wstat_fallback_fd.c"
    },
    {
      "type": "modify",
      "old_id": "400ac1f29b75a8480168d1279948c1963f312112",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/msvcr110plus_stat32.c",
      "new_id": "9042cea6a47a6d61ba55c91feeba849c58da1c7b",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/msvcr110plus_stat32.c"
    },
    {
      "type": "modify",
      "old_id": "299abd8cb0c2c1dd269046a627deb25606bc5cc9",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/msvcr110plus_stat64i32.c",
      "new_id": "9ccd4621cbadb6650a659c04fe272c7b10715f4e",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/msvcr110plus_stat64i32.c"
    },
    {
      "type": "modify",
      "old_id": "85291d93120b006d065f5c5ff1d9bf1f42ed859b",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/msvcr110plus_wstat32.c",
      "new_id": "bbae9c249dfe9f5d736a52d17ba85fe5ebbe3ebc",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/msvcr110plus_wstat32.c"
    },
    {
      "type": "modify",
      "old_id": "baff6a09ea4ff00538838be11a35c46d76354b50",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/msvcr110plus_wstat64i32.c",
      "new_id": "e0a37f495a9435235162ee8305402b2a586cc4f2",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/msvcr110plus_wstat64i32.c"
    },
    {
      "type": "modify",
      "old_id": "8650db23df0591623d3a4fb47429f990abc46487",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/msvcr110pre_stat32.c",
      "new_id": "296f7c3130a897441cbb013c65763f329dd6b757",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/msvcr110pre_stat32.c"
    },
    {
      "type": "modify",
      "old_id": "d929a4f09936744f5fb3a3d4a1522c5997ff375a",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/msvcr110pre_stat64i32.c",
      "new_id": "7e2cdf77927bab599f3fdae573abf0c21ff4f1bf",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/msvcr110pre_stat64i32.c"
    },
    {
      "type": "modify",
      "old_id": "308c7f6446afebc40d781e8d05fc7e3683487d79",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/msvcr110pre_wstat32.c",
      "new_id": "db5886bccdf0269aba7d30efacd20d79c901bb75",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/msvcr110pre_wstat32.c"
    },
    {
      "type": "modify",
      "old_id": "f8ed493e71c8a58b6e0fa11d515970f165decde3",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/msvcr110pre_wstat64i32.c",
      "new_id": "42662878c2c040cefc5ff20dd0bce9c9d9e59622",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/msvcr110pre_wstat64i32.c"
    },
    {
      "type": "modify",
      "old_id": "f8e84bfd0ff9b1dec59017d9d5353449528f2a9b",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/stat32i64.c",
      "new_id": "ddde9205f591165b2ddf96ff488500f5b1fc020b",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/stat32i64.c"
    },
    {
      "type": "modify",
      "old_id": "0cef610b6dd0772ef3cdddb90a7997373cb2b526",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/stat64.c",
      "new_id": "ab8afd637a9dceb37c26ec9fbabb0b43a926f2cc",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/stat64.c"
    },
    {
      "type": "modify",
      "old_id": "d4bb87eaf2d38a346e7ca87f73de949b9d48d344",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/wstat32i64.c",
      "new_id": "240635538ecedaf769b9fe362b0ef469ebcfa546",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/wstat32i64.c"
    },
    {
      "type": "modify",
      "old_id": "0f00a4ed628a83bc662c5a8fcb90f790d039a2ec",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/stdio/wstat64.c",
      "new_id": "dbcf958a3b15ce9feac675ac9940204ccc1d310a",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/stdio/wstat64.c"
    },
    {
      "type": "modify",
      "old_id": "33fa4a1f5a044e82a399b275ca06d0bdd99fdd00",
      "old_mode": 33188,
      "old_path": "mingw-w64-crt/testcases/t_stat.c",
      "new_id": "1e2c23d657243f5ef1ab420ea9cbc678dafa1be6",
      "new_mode": 33188,
      "new_path": "mingw-w64-crt/testcases/t_stat.c"
    }
  ]
}
