From 556e1267b7be84fd25c2d52aa754d623889d52ac Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Sat, 28 Jan 2012 18:40:02 +0100 Subject: [PATCH] Fixed path lookup for alias files: ali, send, whatnow. --- uip/ali.c | 2 +- uip/aliasbr.c | 6 +++--- uip/send.c | 2 +- uip/whatnowsbr.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/uip/ali.c b/uip/ali.c index 3d450d7..8907e69 100644 --- a/uip/ali.c +++ b/uip/ali.c @@ -132,7 +132,7 @@ main(int argc, char **argv) char *dp = NULL; for (ap = brkstring(dp = getcpy(cp), " ", "\n"); ap && *ap; ap++) - if ((i = alias(*ap)) != AK_OK) + if ((i = alias(etcpath(*ap))) != AK_OK) adios(NULL, "aliasing error in %s - %s", *ap, akerror(i)); if (dp) free(dp); diff --git a/uip/aliasbr.c b/uip/aliasbr.c index 85260d8..b9b32fa 100644 --- a/uip/aliasbr.c +++ b/uip/aliasbr.c @@ -125,6 +125,9 @@ aleq(char *string, char *aliasent) } +/* +** file needs to be absolute or relative to cwd +*/ int alias(char *file) { @@ -134,9 +137,6 @@ alias(char *file) register struct aka *ak = NULL; register FILE *fp; - if (*file!='/' && (strncmp(file, "./", 2)!=0 && - strncmp(file, "../", 3)!=0)) - file = etcpath(file); if ((fp = fopen(file, "r")) == NULL) { akerrst = file; return AK_NOFILE; diff --git a/uip/send.c b/uip/send.c index a5589eb..da5f23b 100644 --- a/uip/send.c +++ b/uip/send.c @@ -160,7 +160,7 @@ main(int argc, char **argv) for (ap = brkstring(dp = getcpy(cp), " ", "\n"); ap && *ap; ap++) { vec[vecp++] = "-alias"; - vec[vecp++] = *ap; + vec[vecp++] = getcpy(etcpath(*ap)); } } diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 79f75e5..8cb6744 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -1000,7 +1000,7 @@ sendit(char *sp, char **arg, char *file, int pushed) dp = getcpy(cp); for (ap = brkstring(dp, " ", "\n"); ap && *ap; ap++) { vec[vecp++] = "-alias"; - vec[vecp++] = *ap; + vec[vecp++] = getcpy(etcpath(*ap)); } } -- 1.7.10.4