diff --git a/bin/sh/cd.c b/bin/sh/cd.c index 355e204fe14..66eee00b2c2 100644 --- a/bin/sh/cd.c +++ b/bin/sh/cd.c @@ -376,8 +376,11 @@ getpwd(void) return curdir; p = getpwd2(); - if (p != NULL) + if (p != NULL) { + INTOFF; curdir = savestr(p); + INTON; + } return curdir; }