mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-29 12:20:24 +00:00
Handle hex codes in infocmp output
This commit is contained in:
parent
9cbe2c62de
commit
9db7991a1d
1 changed files with 7 additions and 0 deletions
|
|
@ -177,6 +177,13 @@ func (tc *termcap) setupterm(name string) error {
|
|||
if k := strings.SplitN(val, "=", 2); len(k) == 2 {
|
||||
tc.strs[k[0]] = unescape(k[1])
|
||||
} else if k := strings.SplitN(val, "#", 2); len(k) == 2 {
|
||||
if strings.HasPrefix(k[1], "0x") {
|
||||
if u, err := strconv.ParseUint(k[1][2:], 16, 0); err != nil {
|
||||
return (err)
|
||||
} else {
|
||||
tc.nums[k[0]] = int(u)
|
||||
}
|
||||
}
|
||||
if u, err := strconv.ParseUint(k[1], 10, 0); err != nil {
|
||||
return (err)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue