diff --git a/src/pcre2grep.c b/src/pcre2grep.c index d7410b4..d75917c 100644 --- a/src/pcre2grep.c +++ b/src/pcre2grep.c @@ -3051,7 +3051,8 @@ if (isdirectory(pathname)) if (fnlength > FNBUFSIZ) { fprintf(stderr, "pcre2grep: recursive filename is too long\n"); - return 2; + rc = 2; + break; } sprintf(buffer, "%s%c%s", pathname, FILESEP, nextfile); frc = grep_or_recurse(buffer, dir_recurse, FALSE);