Subject: bug#49758: 27.2; byte-recompile-directory a directory called "~"

From: Al Haji-Ali <[email-masked]>
Date: Wed, 28 Jul 2021 15:31:48 +0100

The following commands

mkdir -p /tmp/test/\~
emacs -Q /tmp/test
M-x byte-recompile-directory RET RET

Causes the home directory to be compiled instead of just directories inside /tmp/test as I would expect.

In GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.12)
 of 2021-05-18 built on lxstaff02
Repository revision: deef5efafb70f4b171265b896505b92b6eef24e6
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: CentOS Linux 7 (Core)

Configured using:
 'configure --prefix=/home/ah180/.local/ --with-json --with-modules
 --with-harfbuzz --with-compress-install --with-threads
 --with-included-regex --with-zlib --with-sound=alsa --without-gconf
 --with-mailutils --with-xft --with-xml2 --with-cairo --with-gconf
 --with-xwidgets --without-toolkit-scroll-bars 'CFLAGS=-O3 -mtune=native
 -march=native -fomit-frame-pointer
 -I/usr/lib/gcc/x86_64-linux-gnu/9/include/
 -L/usr/lib/gcc/x86_64-linux-gnu/9'
 PKG_CONFIG_PATH=/home/ah180/.local/lib/pkgconfig:/usr/lib64/pkgconfig/:/usr/share/pkgconfig/
 CPPFLAGS=-I/home/ah180/.local/include LDFLAGS=-L/home/ah180/.local/lib'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ ZLIB GTK3 X11
XDBE XIM MODULES THREADS XWIDGETS PDUMPER GMP

Important settings:
  value of $LANG: en_GB.utf8
  locale-coding-system: utf-8-unix