diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2001-04-09 20:18:16 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2001-04-09 20:18:16 +0000 |
commit | 2f0ac643e5cb2400b29a99f132b774cce91a2dd4 (patch) | |
tree | a6eaf5f6f42a7888443212806fbbd7c7094d1fac /test/testnames.c | |
parent | 3f8378ec3d7a7812fcb696d96c2de440023f35b6 (diff) | |
download | apr-2f0ac643e5cb2400b29a99f132b774cce91a2dd4.tar.gz |
Hmmm... fgets() is flavored a bit differenly from gets()
git-svn-id: https://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); |