Vim will crash if started with "-n" argument, and a :vimgrep command is executed with a pattern that does match at least one of the scanned files.
To Reproduce
gvim -n.:vimgrep /a/ *.Expected behavior
Command is expected to return a list with several files (in quickfix window) and open the first one of them.
Environment:
The bug was introduced by v8.2.1384, and still present on v8.2.1548
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Sorry I checked the wrong commit; 8.2.1383 instead of 8.2.1384.
Can confirm that this patch fixes the issue:
diff --git a/src/quickfix.c b/src/quickfix.c index 99b0169ea..99847db13 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -6022,7 +6022,7 @@ vgr_process_args( static int existing_swapfile(buf_T *buf) { - if (buf->b_ml.ml_mfp != NULL) + if ((buf->b_ml.ml_mfp != NULL) && (buf->b_ml.ml_mfp->mf_fname != NULL)) { char_u *fname = buf->b_ml.ml_mfp->mf_fname; size_t len = STRLEN(fname);
Thank you @yegappan.
—
You are receiving this because you commented.