On 2025-11-27 02:05, Pavel Raiskup wrote:
Seems like the patch has broken our packaging CI, the build now fails on:

Thanks for reporting that. That's a commit bug: I committed the wrong code. I fixed it by installing the attached.

From 505cf47a0af029c9b8164f525f44b3c36c89407a Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Thu, 27 Nov 2025 11:11:25 -0800
Subject: [PATCH] Fix commit typo when bringing back placeholders

Problem reported by Pavel Raiskup in:
https://lists.gnu.org/r/bug-tar/2025-11/msg00028.html
* src/extract.c (contains_dot_dot): Bring back this function here,
from its former location in src/names.c.  Make it static since
it is used only in this compilation unit.
---
 src/extract.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/extract.c b/src/extract.c
index 4345b528..92381edb 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -72,6 +72,23 @@ implemented (int err)
 	    || (EOPNOTSUPP != ENOTSUP && err == EOPNOTSUPP));
 }
 
+/* Return true if NAME contains ".." as a file name component.  */
+static bool
+contains_dot_dot (char const *name)
+{
+  char const *p = name + FILE_SYSTEM_PREFIX_LEN (name);
+
+  for (;; p++)
+    {
+      if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2]))
+	return true;
+
+      for (; ! ISSLASH (*p); p++)
+	if (!*p)
+	  return false;
+    }
+}
+
 /* List of directories whose statuses we need to extract after we've
    finished extracting their subsidiary files.  Ordinarily the head of
    the list has the longest name, and each non-head element is an
-- 
2.51.0

Reply via email to