From 6becc97433cc7caeae462df56c5ed5660fefe232 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 24 Jul 2021 18:09:14 +0200 Subject: [PATCH] Tweak Fdirectory_append slightly * src/fileio.c (Fdirectory_append): Make the xfree condition more robust. --- src/fileio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index ddce4723f42..643fc361689 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -827,11 +827,11 @@ usage: (record DIRECTORY &rest COMPONENTS) */) memcpy (p, SSDATA (arg), SBYTES (arg)); p += SBYTES (arg); /* The last element shouldn't have a slash added at the end. */ - if (i < nargs -1 && !IS_DIRECTORY_SEP (*(p - 1))) + if (i < nargs - 1 && !IS_DIRECTORY_SEP (*(p - 1))) *p++ = DIRECTORY_SEP; } - if (multibytes != 0 && multibytes != nargs) + if (elements != args) xfree (elements); return result; -- 2.39.2