path: root/include
authorSergey Poznyakoff <>2019-06-13 11:20:20 (GMT)
committer Sergey Poznyakoff <>2019-06-13 11:20:20 (GMT)
commit12304127b52650588877f00b0c4b32dae083e852 (patch) (side-by-side diff)
treee6a2fa21b66d16a82a7913933b88bd091f633dc6 /include
parentdbe318987cf3a36fe63893205d3df0dc3be7fa4a (diff)
wordsplit: configurable order of lookups if both WRDSF_ENV and WRDSF_GETVAR are set
* lib/wordsplit.h (WRDSO_GETVARPREF): New option. * lib/wordsplit.c (wordsplit_find_env): Rewrite as wsplt_env_lookup wsplt_env_getvar): New function. (expvar): Select preference of wsplt_env_lookup vs. wsplt_env_getvar depending on the value if WRDSO_GETVARPREF option.
Diffstat (limited to 'include') (more/less context) (ignore whitespace changes)
1 files changed, 2 insertions, 1 deletions
diff --git a/include/wordsplit.h b/include/wordsplit.h
index 0d6eef3..3451979 100644
--- a/include/wordsplit.h
+++ b/include/wordsplit.h
@@ -216,7 +216,8 @@ struct wordsplit
#define WRDSO_FAILGLOB 0x00000002
/* Allow a leading period to be matched by metacharacters. */
#define WRDSO_DOTGLOB 0x00000004
-/* Unused value: 0x00000008 */
+/* Prefer ws_getvar over lookup in ws_env, if both are supplied */
+#define WRDSO_GETVARPREF 0x00000008
/* Keep backslash in unrecognized escape sequences in words */
#define WRDSO_BSKEEP_WORD 0x00000010
/* Handle octal escapes in words */

Return to:

Send suggestions and report system problems to the System administrator.