Grep recognises syntactically incorrect patterns, such as '[', and prints a diagnostic. It then goes ahead and tries to execute its compiled pattern on the input, resulting in infinite loops and other uglies. A fix is to exit after the diagnostic. diff oldgrep.c newgrep.c 186a187 > exit(2); Ken Lalonde