Hello,

> > According to Keith Marshall on 5/9/2008 2:18 PM:
> > | Having successfully built autoconf-2.62 for use with MSYS, on
> > | MS-Windows, `make check' fails as follows:--
> > |   /bin/sh ./testsuite
> > |   rm: reading directory `tdir /': No such file or directory
> > |   testsuite: error: invalid content: atlocal

an observation:
The atlocal file is included like this:

   . ./$at_file || AS_ERROR([invalid content: $at_file])
  
(see ./lib/autotest/general.m4)

So if the problematic rm -rf were not the very last command in the
atlocal script, ./testsuite would not bail out.
(The error message itself is not a real problem, at least for a bug
in MSYS which is to be fixed eventually.)

Looking at the comments in this thread, I made up this:

# Can we create directories with trailing whitespaces in their name?
rm -rf 'tdir '&&
  mkdir 'tdir ' &&
  touch 'tdir /tfile' 2>/dev/null
a=$?
rm -rf 'tdir '
case $a$? in #(
00)
  func_sanitize_dir_name () { echo "$@"; } ;; #(
*)
  func_sanitize_dir_name () { echo "$@" | sed 's/  *$//'; } ;;
esac

What do you think about it?

Have a nice day,
Stepan


Reply via email to