From e2ed66254b3bf0f87da2fd0419f11b93838d883c Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Tue, 9 Jul 2024 10:06:00 +0800 Subject: [PATCH] Simple backup when macOS [GitHub link #44] --- include/chsrc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/chsrc.h b/include/chsrc.h index 9e56ad9..923eaec 100644 --- a/include/chsrc.h +++ b/include/chsrc.h @@ -7,7 +7,7 @@ * Contributors : Peng Gao * | * Created on : <2023-08-29> - * Last modified : <2024-07-08> + * Last modified : <2024-07-09> * * chsrc 头文件 * ------------------------------------------------------------*/ @@ -709,9 +709,9 @@ chsrc_backup (const char *path) { char *cmd = NULL; - if (xy_on_bsd) + if (xy_on_bsd || xy_on_macos) { - // 似乎BSD的cp并没有 --backup='t' 选项 + /* BSD 和 macOS 的 cp 不支持 --backup 选项 */ cmd = xy_strjoin (5, "cp -f ", path, " ", path, ".bak"); } else if (xy_on_windows)