comparison src/dict.c @ 16902:23645f9a5ce2 v8.1.1452

patch 8.1.1452: line and col property of popup windows not properly checked commit https://github.com/vim/vim/commit/b0ebbda06cf1a4a7c40cb274529c4c53de534e32 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 2 16:51:21 2019 +0200 patch 8.1.1452: line and col property of popup windows not properly checked Problem: Line and col property of popup windows not properly checked. Solution: Check for "+" or "-" sign.
author Bram Moolenaar <Bram@vim.org>
date Sun, 02 Jun 2019 17:00:05 +0200
parents ce04ebdf26b8
children efc6f5e3b543
comparison
equal deleted inserted replaced
16901:ba2e4ebe7b8f 16902:23645f9a5ce2
603 return 0; 603 return 0;
604 return tv_get_number(&di->di_tv); 604 return tv_get_number(&di->di_tv);
605 } 605 }
606 606
607 /* 607 /*
608 * Get a number item from a dictionary.
609 * Returns 0 if the entry doesn't exist.
610 * Give an error if the entry is not a number.
611 */
612 varnumber_T
613 dict_get_number_check(dict_T *d, char_u *key)
614 {
615 dictitem_T *di;
616
617 di = dict_find(d, key, -1);
618 if (di == NULL)
619 return 0;
620 if (di->di_tv.v_type != VAR_NUMBER)
621 {
622 semsg(_(e_invarg2), tv_get_string(&di->di_tv));
623 return 0;
624 }
625 return tv_get_number(&di->di_tv);
626 }
627
628 /*
608 * Return an allocated string with the string representation of a Dictionary. 629 * Return an allocated string with the string representation of a Dictionary.
609 * May return NULL. 630 * May return NULL.
610 */ 631 */
611 char_u * 632 char_u *
612 dict2string(typval_T *tv, int copyID, int restore_copyID) 633 dict2string(typval_T *tv, int copyID, int restore_copyID)