From ecba959f287c78b1d426c1c7856828f6e9c75882 Mon Sep 17 00:00:00 2001 From: David Briscoe Date: Thu, 4 Feb 2021 16:13:07 -0800 Subject: [PATCH] Write msgfmt output to /NUL Fix NUL file created when opening a .po file. Using -o NUL actually creates a file called NUL in the current directory. Using /NUL doesn't create one in C:\ (the drive the file is located on) or any visible drive. Despite msgfmt being able to create the file NUL (which isn't supposed to be allowed), it's difficult to delete NUL (windows explorer can't handle it but WSL's unix rm can remove it). Test Open po file and see the same warnings as before, but no NUL file created. Using msgfmt.exe provided by git (installed via scoop). --- autoload/airline/extensions/po.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/po.vim b/autoload/airline/extensions/po.vim index 0530206c..116625f9 100644 --- a/autoload/airline/extensions/po.vim +++ b/autoload/airline/extensions/po.vim @@ -65,8 +65,9 @@ function! airline#extensions#po#stats() return b:airline_po_stats endif + " Write stdout to null because we only want to see warnings. if g:airline#init#is_windows - let cmd = 'msgfmt --statistics -o NUL ' + let cmd = 'msgfmt --statistics -o /NUL ' else let cmd = 'msgfmt --statistics -o /dev/null -- ' endif