summaryrefslogtreecommitdiff
path: root/system/git/0001-gc-use-s-type-character-for-fscanf.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-08 02:02:24 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-08 02:02:24 -0500
commitfd2bb2f751c13b3c0c002b8e012810902b9da364 (patch)
tree17b2e38c966c9f96cfa568c1f572261a289590e6 /system/git/0001-gc-use-s-type-character-for-fscanf.patch
parentb0a5136bf3326ba38b360be288d06f9a27f2a4d2 (diff)
downloadpackages-fd2bb2f751c13b3c0c002b8e012810902b9da364.tar.gz
packages-fd2bb2f751c13b3c0c002b8e012810902b9da364.tar.bz2
packages-fd2bb2f751c13b3c0c002b8e012810902b9da364.tar.xz
packages-fd2bb2f751c13b3c0c002b8e012810902b9da364.zip
harmony -> system
Diffstat (limited to 'system/git/0001-gc-use-s-type-character-for-fscanf.patch')
-rw-r--r--system/git/0001-gc-use-s-type-character-for-fscanf.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/system/git/0001-gc-use-s-type-character-for-fscanf.patch b/system/git/0001-gc-use-s-type-character-for-fscanf.patch
new file mode 100644
index 000000000..e3fe78cf6
--- /dev/null
+++ b/system/git/0001-gc-use-s-type-character-for-fscanf.patch
@@ -0,0 +1,33 @@
+From afceb0f7755a87d0dd2194e95f26c9dc8f4bc688 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Fri, 15 Sep 2017 23:55:57 -0500
+Subject: [PATCH] gc: use 's' type character for fscanf
+
+The ISO C standard states that using a field width together with the 'c'
+type character will read the exact amount specified; if that amount of
+bytes is not available, a match error occurs.
+
+This patch allows the t6500 test to pass on the musl libc, and `git gc`
+to behave correctly on systems utilising musl.
+
+Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
+---
+ builtin/gc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builtin/gc.c b/builtin/gc.c
+index 3c78fcb..bb2d6c1 100644
+--- a/builtin/gc.c
++++ b/builtin/gc.c
+@@ -258,7 +258,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
+ int should_exit;
+
+ if (!scan_fmt)
+- scan_fmt = xstrfmt("%s %%%dc", "%"SCNuMAX, HOST_NAME_MAX);
++ scan_fmt = xstrfmt("%s %%%ds", "%"SCNuMAX, HOST_NAME_MAX);
+ fp = fopen(pidfile_path, "r");
+ memset(locking_host, 0, sizeof(locking_host));
+ should_exit =
+--
+2.10.0
+