vdoc: fix segfault on `v doc -m -f html vlib`

pull/8531/head
Delyan Angelov 2021-02-02 17:38:32 +02:00
parent ffedbe4b81
commit 02bef1ae2b
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
3 changed files with 4 additions and 4 deletions

View File

@ -97,7 +97,7 @@ fn main() {
fn process_cli_args() &Context { fn process_cli_args() &Context {
mut context := &Context{ mut context := &Context{
pref: 0 pref: pref.new_preferences()
} }
context.myself = os.executable() context.myself = os.executable()
mut fp := flag.new_flag_parser(os.args_after('test-parser')) mut fp := flag.new_flag_parser(os.args_after('test-parser'))

View File

@ -113,7 +113,7 @@ pub fn new(input_path string) Doc {
time_generated: time.now() time_generated: time.now()
} }
d.fmt = fmt.Fmt{ d.fmt = fmt.Fmt{
pref: 0 pref: d.prefs
indent: 0 indent: 0
is_debug: false is_debug: false
table: d.table table: d.table

View File

@ -10,8 +10,8 @@ pub const (
default_module_path = os.vmodules_dir() default_module_path = os.vmodules_dir()
) )
pub fn new_preferences() Preferences { pub fn new_preferences() &Preferences {
mut p := Preferences{} mut p := &Preferences{}
p.fill_with_defaults() p.fill_with_defaults()
return p return p
} }