Restarting GMRES, a linear solver frequently used in numerical schemes, is known to suffer from stagnation. In this paper, a simple strategy is proposed to detect and avoid stagnation, without modifying the standard GMRES code. Numerical tests with the modified GMRES(m), GMRESH(m) procedure, alone and as part of an inexact Newton procedure with several choices for the forcing term, demonstrate ...