fprintf (stderr, "%s: could not get current directory: %s: %s\n",
(for_whom && *for_whom) ? for_whom : get_name_for_error (),
the_current_working_directory[0]
? the_current_working_directory
: bash_getcwd_errstr,
strerror (errno));
It must not be bash that's outputting this error then.
Guy