wrowe 01/04/09 13:18:17
Modified: test testnames.c
Log:
Hmmm... fgets() is flavored a bit differenly from gets()
Revision Changes Path
1.3 +7 -0 apr/test/testnames.c
Index: testnames.c
===================================================================
RCS file: /home/cvs/apr/test/testnames.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- testnames.c 2001/04/09 04:57:46 1.2
+++ testnames.c 2001/04/09 20:18:16 1.3
@@ -100,6 +100,7 @@
{
char rootpath[256];
char addpath[256];
+ char *eos;
if (apr_initialize() != APR_SUCCESS) {
fprintf(stderr, "Couldn't initialize.");
@@ -117,9 +118,15 @@
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);