aboutsummaryrefslogtreecommitdiffstats
path: root/test/test-relative-from-root.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-relative-from-root.sh')
-rwxr-xr-xtest/test-relative-from-root.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test-relative-from-root.sh b/test/test-relative-from-root.sh
new file mode 100755
index 0000000..e2c230e
--- /dev/null
+++ b/test/test-relative-from-root.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+# pseudo had a bug that made it abort() when looking up a relative path from
+# base "/", such as by openat(dirfd_of_root, "foo/bar") or when cwd is /. It
+# tried to look up base+"/"+path = "//foo/bar", which is wrong.
+
+set -e
+
+touch f1
+relative_pwd=${PWD#/}
+
+cd /
+cat "$relative_pwd/f1"
+
+rm "$relative_pwd/f1"