aboutsummaryrefslogtreecommitdiff
path: root/lib/expand.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-10-09 17:58:33 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-10-09 17:58:33 +0300
commitf88aa8437de7e756aa5b8eb052ae4649bb3891cb (patch)
tree3030799fa8f8e6690bd71964c8de2c840dfa9d56 /lib/expand.c
parentba2c9a15f42437c051738ca93d7129245791d660 (diff)
downloadeclat-f88aa8437de7e756aa5b8eb052ae4649bb3891cb.tar.gz
eclat-f88aa8437de7e756aa5b8eb052ae4649bb3891cb.tar.bz2
Improve the docs.
* doc/eclat.conf.5: New file. * doc/Makefile.am: Add new file. * doc/eclat.1: Update. * lib/expand.c (eclat_expand_kw): New macro: login. * lib/filemap.c: Add the "key" statement. * lib/gdbmmap.c: Likewise. * lib/ldapmap.c: Likewise. (ldap_map_open): Always expand binddn.
Diffstat (limited to 'lib/expand.c')
-rw-r--r--lib/expand.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/expand.c b/lib/expand.c
index 2db35e0..8a26816 100644
--- a/lib/expand.c
+++ b/lib/expand.c
@@ -27,7 +27,7 @@ eclat_expand_kw(const char *input, const char **ukw)
struct wordsplit ws;
char *ret;
static char **defkw;
- static size_t defkwsize = 4;
+ static size_t defkwsize = 6;
const char **kw;
size_t kwsize;
int i;
@@ -40,10 +40,12 @@ eclat_expand_kw(const char *input, const char **ukw)
"cannot determine user name (uid=%lu)",
(unsigned long) uid);
defkw = grecs_calloc(defkwsize, sizeof(defkw[0]));
- defkw[0] = "user";
+ defkw[0] = "login";
defkw[1] = grecs_strdup(pw->pw_name);
- defkw[2] = "home";
- defkw[3] = grecs_strdup(pw->pw_dir);
+ defkw[2] = "user";
+ defkw[3] = grecs_strdup(pw->pw_name);
+ defkw[4] = "home";
+ defkw[5] = grecs_strdup(pw->pw_dir);
}
if (ukw) {
@@ -67,6 +69,7 @@ eclat_expand_kw(const char *input, const char **ukw)
WRDSF_ENV | WRDSF_ENV_KV | WRDSF_WARNUNDEF | WRDSF_ERROR))
die(EX_SOFTWARE, "error expanding pattern %s: %s",
input, wordsplit_strerror(&ws));
+
free(kw);
ret = ws.ws_wordv[0];
ws.ws_wordv[0] = NULL;

Return to:

Send suggestions and report system problems to the System administrator.