--- detex-src/detex.l	(revision 64397)
+++ detex-src/detex.l	(working copy)
@@ -346,15 +349,30 @@ VERBSYMBOL	=|\\leq|\\geq|\\in|>|<|\\subseteq|\subs
 							footnoteLevel = currBracesLevel;
 							++currBracesLevel;
 							}
-<Normal>"\\verb" /* ignore \verb<ch>...<ch> */	{   if (fLatex) {
-						 	char verbchar, c;
-						 	verbchar = input();
-						 	while ((c = input()) != verbchar)
-							    /*if (c == '\n')
-								NEWLINE;*/
-								putchar(c);
-						    }
-						    IGNORE;
+<Normal>"\\verb" /* ignore \verb<ch>...<ch> */	{
+  /* Sorry to use different formatting, but it seemed better not
+     to cram all this code over in the rightmost 20 chars. */
+  if (fLatex) {
+    char verbchar, c;
+    verbchar = input();
+    if (verbchar != EOF) {
+      while ((c = input()) != verbchar && c != '\n' && c != EOF) {
+        putchar(c);
+      }
+    }
+    /* would be nice to include input filenames and line numbers */
+    if (verbchar == EOF || c == EOF) {
+      /* do this test first in case verbchar is eof */
+      ErrorExit("\\verb not complete before eof");
+    }
+    if (c == '\n') {
+      char delim[2];
+      delim[0] = verbchar;
+      delim[1] = 0;
+      Warning("\\verb not terminated before eol, delimiter", delim);
+    }
+  }
+  IGNORE;
 						}
 
 <Normal>"\\newcommand"				{ LATEX; KILLARGS(2); }
