From 1f61623eebbee646b494debc5109d3ca9531b7c0 Mon Sep 17 00:00:00 2001
From: happy-game <happygame1024@gmail.com>
Date: Mon, 4 Nov 2024 06:39:56 +0000
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=E9=9D=9Ewin?=
 =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=B8=8A=E4=BC=9A=E4=BA=A7=E7=94=9Fnul?=
 =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/chsrc-framework.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/chsrc-framework.h b/src/chsrc-framework.h
index 309fc64..df567dd 100644
--- a/src/chsrc-framework.h
+++ b/src/chsrc-framework.h
@@ -5,9 +5,9 @@
  * File Authors  : Aoran Zeng <ccmywish@qq.com>
  *               |  Heng Guo  <2085471348@qq.com>
  * Contributors  :  Peng Gao  <gn3po4g@outlook.com>
- *               |
+ *               |  Happy Game <happygame10124@gmail.com>
  * Created On    : <2023-08-29>
- * Last Modified : <2024-09-29>
+ * Last Modified : <2024-11-04>
  *
  * chsrc 框架
  * ------------------------------------------------------------*/
@@ -442,11 +442,14 @@ measure_speed_for_url (void *url)
   // https://github.com/RubyMetric/chsrc/issues/65
   // curl (仅)在 Cygwin 上 -o nul 会把 nul 当做普通文件
   // 为了践行 chsrc everywhere 的承诺,我们也考虑支持 Cygwin
+  // 确保只在windows上运行 cygcheck,否则会生产nul文件
+#if  XY_On_Windows
   if (0==system ("cygcheck --version >nul 2>nul"))
     {
       on_cygwin = true;
       os_devnull = "/tmp/chsrc-measure-downloaded";
     }
+#endif
 
   // 我们用 —L,因为Ruby China源会跳转到其他地方
   // npmmirror 也会跳转