26763: fix problem on failed cd -s to relative path
[zsh.git] / Src / Modules / errnames1.awk
blob5c41197cb6d2060560fd94b87faf690b7f4311f3
1 # Edited version of Src/signames1.awk.
3 # This is an awk script which finds out what the possibilities for
4 # the error names are, and dumps them out so that cpp can turn them
5 # into numbers. Since we don't need to decide here what the
6 # real signals are, we can afford to be generous about definitions,
7 # in case the definitions are in terms of other definitions.
8 # However, we need to avoid definitions with parentheses, which will
9 # mess up the syntax.
10 BEGIN { printf "#include <errno.h>\n\n" }
12 /^[\t ]*#[\t ]*define[\t ]*E[A-Z0-9]*[\t ][\t ]*[^(\t ]/ {
13 eindex = index($0, "E")
14 etail = substr($0, eindex, 80)
15 split(etail, tmp)
16 enam = substr(tmp[1], 2, 20)
17 printf("XXNAMES XXE%s E%s\n", enam, enam)