Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151363752
D50974.id157435.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50974.id157435.diff
View Options
diff --git a/bin/sh/cd.c b/bin/sh/cd.c
--- a/bin/sh/cd.c
+++ b/bin/sh/cd.c
@@ -99,8 +99,6 @@
if ((dest = *argptr) == NULL && (dest = bltinlookup("HOME", 1)) == NULL)
error("HOME not set");
- if (*dest == '\0')
- dest = ".";
if (dest[0] == '-' && dest[1] == '\0') {
dest = bltinlookup("OLDPWD", 1);
if (dest == NULL)
diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile
--- a/bin/sh/tests/builtins/Makefile
+++ b/bin/sh/tests/builtins/Makefile
@@ -52,6 +52,7 @@
${PACKAGE}FILES+= cd9.0 cd9.0.stdout
${PACKAGE}FILES+= cd10.0
${PACKAGE}FILES+= cd11.0
+${PACKAGE}FILES+= cd12.0 cd12.0.stderr
${PACKAGE}FILES+= command1.0
${PACKAGE}FILES+= command2.0
${PACKAGE}FILES+= command3.0
diff --git a/bin/sh/tests/builtins/cd12.0 b/bin/sh/tests/builtins/cd12.0
new file mode 100644
--- /dev/null
+++ b/bin/sh/tests/builtins/cd12.0
@@ -0,0 +1,3 @@
+(cd /bin) || exit 1
+cd "" && exit 1
+exit 0
diff --git a/bin/sh/tests/builtins/cd12.0.stderr b/bin/sh/tests/builtins/cd12.0.stderr
new file mode 100644
--- /dev/null
+++ b/bin/sh/tests/builtins/cd12.0.stderr
@@ -0,0 +1 @@
+cd: : No such file or directory
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 9:57 PM (23 m, 50 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31072169
Default Alt Text
D50974.id157435.diff (1 KB)
Attached To
Mode
D50974: sh(1): Do not interpret chdir to "" as equivalent to chdir with no argument
Attached
Detach File
Event Timeline
Log In to Comment