summaryrefslogtreecommitdiff
path: root/test/testnames.c
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-04-09 20:18:16 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-04-09 20:18:16 +0000
commit35a57174efc27cee503e1e4a8f1d66e5fce896e4 (patch)
treea6eaf5f6f42a7888443212806fbbd7c7094d1fac /test/testnames.c
parentc91aa2a613238c2601c97177f11d4e1ea1269977 (diff)
downloadlibapr-35a57174efc27cee503e1e4a8f1d66e5fce896e4.tar.gz
Hmmm... fgets() is flavored a bit differenly from gets()
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61491 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testnames.c')
-rw-r--r--test/testnames.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/testnames.c b/test/testnames.c
index 02372686a..009d92ae1 100644
--- a/test/testnames.c
+++ b/test/testnames.c
@@ -100,6 +100,7 @@ int main(void)
{
char rootpath[256];
char addpath[256];
+ char *eos;
if (apr_initialize() != APR_SUCCESS) {
fprintf(stderr, "Couldn't initialize.");
@@ -117,9 +118,15 @@ int main(void)
fprintf(stdout, "\nEnter a root path$ ");
if (!fgets(rootpath, 256, stdin))
exit(0);
+ for (eos = strchr(rootpath, '\0'); --eos >= rootpath; )
+ if (isspace(*eos))
+ *eos = '\0';
fprintf(stdout, "Enter an add path$ ");
if (!fgets(addpath, 256, stdin))
exit(0);
+ for (eos = strchr(addpath, '\0'); --eos >= addpath; )
+ if (isspace(*eos))
+ *eos = '\0';
merge_result(rootpath, addpath, 0);
merge_result(rootpath, addpath, APR_FILEPATH_NOTABOVEROOT);
merge_result(rootpath, addpath, APR_FILEPATH_SECUREROOT);