Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bash] Improve mawk detection (#3463)
* Use the all-compatible mawk `-W version` option. #3313 (comment). * Run the command and not a function consistently with #3462. The version check bash code relies on the following mawk source code, extracted from mawk 1.3.4 20230322. ``` version.c: 18- #include "init.h" 19- #include "patchlev.h" 20- 21: #define VERSION_STRING \ 22- "mawk %d.%d%s %s\n\ 23- Copyright 2008-2022,2023, Thomas E. Dickey\n\ 24- Copyright 1991-1996,2014, Michael D. Brennan\n\n" .... 30- void 31- print_version(FILE *fp) 32- { 33: fprintf(fp, VERSION_STRING, PATCH_BASE, PATCH_LEVEL, PATCH_STRING, DATE_STRING); 34- fflush(fp); 35- 36- #define SHOW_RANDOM "random-funcs:" patchlev.h: 13- /* 14- * $MawkId: patchlev.h,v 1.128 2023/03/23 00:23:57 tom Exp $ 15- */ 16: #define PATCH_BASE 1 17- #define PATCH_LEVEL 3 18- #define PATCH_STRING ".4" 19- #define DATE_STRING "20230322" ``` Co-authored-by: Junegunn Choi <[email protected]>
- Loading branch information