Diff for /libaitwww/src/tools.c between versions 1.4 and 1.5

version 1.4, 2012/09/20 14:19:45 version 1.5, 2013/05/30 09:25:35
Line 12  terms: Line 12  terms:
 All of the documentation and software included in the ELWIX and AITNET  All of the documentation and software included in the ELWIX and AITNET
 Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>  Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org>
   
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
         by Michael Pounov <misho@elwix.org>.  All rights reserved.          by Michael Pounov <misho@elwix.org>.  All rights reserved.
   
 Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
Line 103  www_cmptype(const char *ct, const char *type) Line 103  www_cmptype(const char *ct, const char *type)
  *   *
  * @str = query string   * @str = query string
  * @delim = delimiter   * @delim = delimiter
 * return: NULL error or AV pair, must be io_free() after use! * return: NULL error or AV pair, must be e_free() after use!
  */   */
 ait_val_t *  ait_val_t *
 www_getpair(char ** __restrict str, const char *delim)  www_getpair(char ** __restrict str, const char *delim)
Line 114  www_getpair(char ** __restrict str, const char *delim) Line 114  www_getpair(char ** __restrict str, const char *delim)
   
         assert(str && *str && delim);          assert(str && *str && delim);
   
        s = io_allocVar();        s = ait_allocVar();
         if (!s) {          if (!s) {
                www_SetErr(io_GetErrno(), "%s", io_GetError());                www_SetErr(elwix_GetErrno(), "%s", elwix_GetError());
                 return NULL;                  return NULL;
         }          }
   
Line 137  www_getpair(char ** __restrict str, const char *delim) Line 137  www_getpair(char ** __restrict str, const char *delim)
  * @str = string   * @str = string
  * return: digit   * return: digit
  */   */
inline charchar
 www_x2c(const char *str)  www_x2c(const char *str)
 {  {
         register char digit;          register char digit;
Line 157  www_x2c(const char *str) Line 157  www_x2c(const char *str)
  * @str = string   * @str = string
  * return: none   * return: none
  */   */
inline voidvoid
 www_unescape(char * __restrict str)  www_unescape(char * __restrict str)
 {  {
         register int i, j;          register int i, j;
Line 183  www_unescape(char * __restrict str) Line 183  www_unescape(char * __restrict str)
  * www_undot() - Undotted and clean WWW query filename   * www_undot() - Undotted and clean WWW query filename
  *   *
  * @pname = query filename   * @pname = query filename
 * return: =NULL error or !=NULL allocated valid filename, after use you must call io_freeVar() * return: =NULL error or !=NULL allocated valid filename, after use you must call ait_freeVar()
  */   */
 ait_val_t *  ait_val_t *
 www_undot(const char * __restrict pname)  www_undot(const char * __restrict pname)
Line 198  www_undot(const char * __restrict pname) Line 198  www_undot(const char * __restrict pname)
         if (*pname != '/')          if (*pname != '/')
                 return NULL;                  return NULL;
   
        v = io_allocVar();        v = ait_allocVar();
         if (!v) {          if (!v) {
                www_SetErr(io_GetErrno(), "%s", io_GetError());                www_SetErr(elwix_GetErrno(), "%s", elwix_GetError());
                 return NULL;                  return NULL;
         } else {          } else {
                 AIT_SET_STR(v, pname + 1);                  AIT_SET_STR(v, pname + 1);
Line 249  www_undot(const char * __restrict pname) Line 249  www_undot(const char * __restrict pname)
         /* check for valid filename */          /* check for valid filename */
         if (*fname == '/' || (fname[0] == '.' && fname[1] == '.' &&           if (*fname == '/' || (fname[0] == '.' && fname[1] == '.' && 
                                 (!fname[2] || fname[2] == '/'))) {                                  (!fname[2] || fname[2] == '/'))) {
                io_freeVar(&v);                ait_freeVar(&v);
                 return NULL;                  return NULL;
         }          }
   

Removed from v.1.4  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>