26763: fix problem on failed cd -s to relative path
[zsh.git] / Src / Modules / curses_keys.awk
blobffb182c3526f47d6124fed0ae2da4c9035c55d60
1 BEGIN {nkeydefs = 0}
3 /^[\t ]*#[\t ]*define[\t _]*KEY_[A-Z0-9_]*[\t ]/ {
4 keyindex = index($0, "KEY_")
5 keytail = substr($0, keyindex, 80)
6 split(keytail, tmp)
7 keynam = substr(tmp[1], 5, 30)
8 if (keynam != "MIN" && keynam != "MAX" && keynam != "CODE_YES") {
9 name[nkeydefs++] = keynam
13 END {
14 printf("static const struct zcurses_namenumberpair keypad_names[] = {\n")
15 for (i = 0; i < 0 + nkeydefs; i++)
16 printf(" {\"%s\", KEY_%s},\n", name[i], name[i])
17 printf(" {NULL, 0}\n")
18 printf("};\n")