wrowe       01/05/15 20:52:01

  Modified:    test     testnames.c
  Log:
    Hmmm... been sitting on this little test bench a while, time to share.
  
  Revision  Changes    Path
  1.5       +17 -6     apr/test/testnames.c
  
  Index: testnames.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testnames.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- testnames.c       2001/05/01 11:09:21     1.4
  +++ testnames.c       2001/05/16 03:52:01     1.5
  @@ -70,6 +70,21 @@
       apr_terminate();
   }
   
  +static void root_result(char *path)
  +{
  +    apr_status_t status;
  +    char errmsg[256];
  +    char *root = NULL;
  +    status = apr_filepath_root(&root, &path, context);
  +    apr_strerror(status, errmsg, sizeof(errmsg));
  +    if (root)
  +        fprintf(stderr, "\tRoot \"%s\" Path \"%s\" (%s)\n", 
  +                root, path, errmsg);
  +    else
  +        fprintf(stderr, "\tPath \"%s\" Error (%s)\n", 
  +                path, errmsg);
  +}
  +
   static void mergeresult(char *rootpath, char *addpath, apr_int32_t 
mergetype, char *tdesc)
   {
       char errmsg[256];
  @@ -82,12 +97,6 @@
       apr_strerror(status, errmsg, sizeof(errmsg));
       if (dstpath) {
           fprintf(stderr, "%s result for %s\n\tResult Path \"%s\"\n", errmsg, 
tdesc, dstpath);
  -        srcpath = dstpath;
  -        status = apr_filepath_root(&dstpath, &srcpath, context);
  -        if (srcpath != dstpath) {
  -            apr_strerror(status, errmsg, sizeof(errmsg));
  -            fprintf(stderr, "\tRoot of \"%s\" (%s)\n", dstpath, errmsg);
  -        }
       }
       else {
           fprintf(stderr, "%s result for %s\n", errmsg, tdesc);
  @@ -132,6 +141,8 @@
           merge_result(rootpath, addpath, APR_FILEPATH_SECUREROOT);
           merge_result(rootpath, addpath, APR_FILEPATH_NOTABSOLUTE);
           merge_result(rootpath, addpath, APR_FILEPATH_NOTRELATIVE);
  +        root_result(rootpath);
  +        root_result(addpath);
       }
       return (0);
   }
  
  
  

Reply via email to