From c319fa82fcd556170a81620eb56b8ffb12f9dc98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B9=8F=E8=B5=B7=E9=B2=B8=E8=90=BD?= <92096903+Gn3po4g@users.noreply.github.com> Date: Sat, 6 Jul 2024 23:21:59 +0800 Subject: [PATCH] Fix: `chsrc_get_cpuarch()` and `chsrc_prepend_to_file()` [GitHub PR #42] * Fix - `chsrc_get_cpuarch()`: Use `uname -m` instead of `-p` - `chsrc_prepend_to_file()`: Add missing space * Add new contributor --- include/chsrc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/chsrc.h b/include/chsrc.h index 56b385c..77241fa 100644 --- a/include/chsrc.h +++ b/include/chsrc.h @@ -4,7 +4,7 @@ * File : chsrc.h * Authors : Aoran Zeng * | Heng Guo <2085471348@qq.com> - * Contributors : Null Nil + * Contributors : Peng Gao * | * Created on : <2023-08-29> * Last modified : <2024-07-03> @@ -680,7 +680,7 @@ chsrc_prepend_to_file (const char *str, const char *file) } else { - cmd = xy_strjoin (4, "sed -i '1i ", str, "'", file); + cmd = xy_strjoin (4, "sed -i '1i ", str, "' ", file); } chsrc_run (cmd, RunOpt_Default); } @@ -750,7 +750,7 @@ chsrc_get_cpuarch () exist = chsrc_check_program ("uname"); if (exist) { - ret = xy_run ("uname -p", 0, NULL); + ret = xy_run ("uname -m", 0, NULL); return ret; } else