rename the real vms_getchar and interpose this one in front of it */
| 120 | |
| 121 | /* rename the real vms_getchar and interpose this one in front of it */ |
| 122 | int |
| 123 | vms_getchar(void) |
| 124 | { |
| 125 | static int althack = 0, altprefix; |
| 126 | char *nhalthack; |
| 127 | int res; |
| 128 | |
| 129 | if (!althack) { |
| 130 | /* one-time init */ |
| 131 | nhalthack = nh_getenv("NH_ALTHACK"); |
| 132 | althack = nhalthack ? 1 : -1; |
| 133 | if (althack > 0) |
| 134 | altprefix = *nhalthack; |
| 135 | } |
| 136 | |
| 137 | #define vms_getchar nh_vms_getchar |
| 138 | |
| 139 | res = vms_getchar(); |
| 140 | if (althack > 0 && res == altprefix) { |
| 141 | res = vms_getchar(); |
| 142 | if (res != ESC) |
| 143 | res = META(res); |
| 144 | } |
| 145 | return res; |
| 146 | } |
| 147 | #endif /*DEBUG*/ |
| 148 | |
| 149 | int |
nothing calls this directly
no test coverage detected