From 99c70cf9c62f173010c927518a4b7c283233c6cd Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 3 Jun 2020 09:03:43 +0200 Subject: [PATCH] pref: do not allow -o .v --- vlib/v/pref/pref.v | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index 2c6ae22718..9c1cd6db77 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -244,6 +244,10 @@ pub fn parse_args(args []string) (&Preferences, string) { } '-o' { res.out_name = cmdline.option(current_args, '-o', '') + if res.out_name.ends_with('.v') { + eprintln('Cannot save output binary in a .v file.') + exit(1) + } i++ } '-b' {