diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2001-04-09 20:18:16 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2001-04-09 20:18:16 +0000 |
commit | 35a57174efc27cee503e1e4a8f1d66e5fce896e4 (patch) | |
tree | a6eaf5f6f42a7888443212806fbbd7c7094d1fac /test/testnames.c | |
parent | c91aa2a613238c2601c97177f11d4e1ea1269977 (diff) | |
download | libapr-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.c | 7 |
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); |