2 ######################################################
4 # Test that whatnow's "cd" copes with directory names
5 # which have spaces and quotes in them (see bug #23319)
7 ######################################################
11 if test -z "${MH_OBJ_DIR}"; then
12 srcdir=`dirname "$0"`/../..
13 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
16 . "$MH_OBJ_DIR/test/common.sh"
20 SPDIR="$MH_TEST_DIR/foo's bar"
23 (cd "$SPDIR" && touch baz boz)
25 expectederr=$MH_TEST_DIR/$$.expectederr
26 actualerr=$MH_TEST_DIR/$$.actualerr
27 expected=$MH_TEST_DIR/$$.expected
28 actual=$MH_TEST_DIR/$$.actual
34 cat > $expectederr <<EOF
37 # ||true to ignore whatnow's exit status
38 # watch the quoting -- shell and printf and then the shell run inside whatnow
39 printf "cd $MH_TEST_DIR/foo\\\\'s\\\\ bar\npwd\n" | \
40 whatnow -noedit -prompt '' 2> "$actualerr" > "$actual" || true
42 check "$expectederr" "$actualerr"
43 check "$expected" "$actual"
45 test ${failed:-0} -eq 0 && rm -r "$SPDIR"