0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.2035: recognizing octal numbers is confusing

Problem:    Recognizing octal numbers is confusing.
Solution:   Introduce scriptversion 4: do not use octal and allow for single
            quote inside numbers.
This commit is contained in:
Bram Moolenaar
2019-09-15 14:33:22 +02:00
parent 50bf7ce0c9
commit 60a8de28d1
8 changed files with 78 additions and 27 deletions

View File

@@ -307,11 +307,15 @@
#define NUMBUFLEN 65
// flags for vim_str2nr()
#define STR2NR_BIN 1
#define STR2NR_OCT 2
#define STR2NR_HEX 4
#define STR2NR_BIN 0x01
#define STR2NR_OCT 0x02
#define STR2NR_HEX 0x04
#define STR2NR_ALL (STR2NR_BIN + STR2NR_OCT + STR2NR_HEX)
#define STR2NR_FORCE 8 // only when ONE of the above is used
#define STR2NR_NO_OCT (STR2NR_BIN + STR2NR_HEX)
#define STR2NR_FORCE 0x80 // only when ONE of the above is used
#define STR2NR_QUOTE 0x10 // ignore embedded single quotes
/*
* Shorthand for unsigned variables. Many systems, but not all, have u_char