@@ -9871,12 +9871,13 @@ f_ch_open(typval_T *argvars, typval_T *rettv)
98719871
98729872 if (argvars[1].v_type == VAR_DICT)
98739873 {
9874- /* parse argdict */
9875- dict_T *dict = argvars[1].vval.v_dict ;
9874+ dict_T *dict = argvars[1].vval.v_dict;
9875+ dictitem_T *item ;
98769876
9877- if (dict_find(dict, (char_u *)"mode", -1) != NULL)
9877+ /* parse argdict */
9878+ if ((item = dict_find(dict, (char_u *)"mode", -1)) != NULL)
98789879 {
9879- mode = get_dict_string(dict, (char_u *)"mode", FALSE );
9880+ mode = get_tv_string(&item->di_tv );
98809881 if (STRCMP(mode, "raw") == 0)
98819882 ch_mode = MODE_RAW;
98829883 else if (STRCMP(mode, "js") == 0)
@@ -9889,12 +9890,12 @@ f_ch_open(typval_T *argvars, typval_T *rettv)
98899890 return;
98909891 }
98919892 }
9892- if (dict_find(dict, (char_u *)"waittime", -1) != NULL)
9893- waittime = get_dict_number(dict, (char_u *)"waittime" );
9894- if (dict_find(dict, (char_u *)"timeout", -1) != NULL)
9895- timeout = get_dict_number(dict, (char_u *)"timeout" );
9896- if (dict_find(dict, (char_u *)"callback", -1) != NULL)
9897- callback = get_dict_string(dict, (char_u *)"callback", FALSE );
9893+ if ((item = dict_find(dict, (char_u *)"waittime", -1) ) != NULL)
9894+ waittime = get_tv_number(&item->di_tv );
9895+ if ((item = dict_find(dict, (char_u *)"timeout", -1) ) != NULL)
9896+ timeout = get_tv_number(&item->di_tv );
9897+ if ((item = dict_find(dict, (char_u *)"callback", -1) ) != NULL)
9898+ callback = get_callback(&item->di_tv );
98989899 }
98999900 if (waittime < 0 || timeout < 0)
99009901 {
0 commit comments