--- bash-4.0/shell.c.orig 2009-10-15 15:57:56.000000000 -0400
+++ bash-4.0/shell.c 2009-10-15 15:58:28.000000000 -0400
@@ -572,7 +572,7 @@
/* running_under_emacs == 2 for `eterm' */
running_under_emacs = (emacs != 0) || (term && STREQN (term, "emacs", 5));
- running_under_emacs += term && STREQN (term, "eterm", 5) && strstr (emacs, "term");
+ running_under_emacs += term && STREQN (term, "eterm", 5) && (emacs != 0) && strstr (emacs, "term");
if (running_under_emacs)
gnu_error_format = 1;