--- origsrc/lib/root-dev-ino.h 2022-04-08 05:22:17.000000000 -0600 +++ src/lib/root-dev-ino.h 2022-05-08 00:59:46.346838200 -0600 @@ -21,19 +21,26 @@ # include "dev-ino.h" # include "same-inode.h" -struct dev_ino * -get_root_dev_ino (struct dev_ino *root_d_i) _GL_ATTRIBUTE_NONNULL (); +struct root_dev_ino +{ + struct dev_ino single_slash; + struct dev_ino double_slash; +}; + +struct root_dev_ino * +get_root_dev_ino (struct root_dev_ino *root_d_i) _GL_ATTRIBUTE_NONNULL (); /* These macros are common to the programs that support the --preserve-root and --no-preserve-root options. */ # define ROOT_DEV_INO_CHECK(Root_dev_ino, Dir_statbuf) \ - (Root_dev_ino && SAME_INODE (*Dir_statbuf, *Root_dev_ino)) + (Root_dev_ino && (SAME_INODE (*Dir_statbuf, (Root_dev_ino)->single_slash) \ + || SAME_INODE (*Dir_statbuf, (Root_dev_ino)->double_slash))) # define ROOT_DEV_INO_WARN(Dirname) \ do \ { \ - if (STREQ (Dirname, "/")) \ + if (STREQ (Dirname, "/") || STREQ (Dirname, "//")) \ error (0, 0, _("it is dangerous to operate recursively on %s"), \ quoteaf (Dirname)); \ else \