/[winpt]/trunk/Src/wptUtil.cpp
ViewVC logotype

Diff of /trunk/Src/wptUtil.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 273 by twoaday, Fri Dec 8 10:22:17 2006 UTC revision 278 by twoaday, Mon Jan 15 22:02:04 2007 UTC
# Line 12  Line 12 
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14   * General Public License for more details.   * General Public License for more details.
  *  
  * You should have received a copy of the GNU General Public License  
  * along with WinPT; if not, write to the Free Software Foundation,  
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  
15   */   */
   
16  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
17  #include <config.h>  #include <config.h>
18  #endif  #endif
# Line 30  Line 25 
25    
26  #include "wptTypes.h"  #include "wptTypes.h"
27    
28    
29  /* code taken from glibc-2.2.1/sysdeps/generic/strsep.c */  /* code taken from glibc-2.2.1/sysdeps/generic/strsep.c */
30  char*  char*
31  strsep (char **stringp, const char *delim)  strsep (char **stringp, const char *delim)
# Line 79  stristr (const char *buf, const char *su Line 75  stristr (const char *buf, const char *su
75      size_t n;      size_t n;
76      size_t buflen = strlen (buf);      size_t buflen = strlen (buf);
77    
78      for( t=buf, n=buflen, s=sub ; n ; t++, n-- ) {      for (t=buf, n=buflen, s=sub ; n ; t++, n--) {
79          if( toupper(*t) == toupper(*s) ) {          if (toupper (*t) == toupper (*s)) {
80              for( buf=t++, buflen = n--, s++;              for( buf=t++, buflen = n--, s++;
81                   n && toupper(*t) == toupper(*s); t++, s++, n-- )                   n && toupper(*t) == toupper(*s); t++, s++, n-- )
82                  ;                  ;
83              if( !*s )              if (!*s)
84                  return buf;                  return buf;
85              t = buf; n = buflen; s = sub ;              t = buf; n = buflen; s = sub ;
86          }          }
# Line 103  check_file_name (const char *fname, int Line 99  check_file_name (const char *fname, int
99    
100      /* If we are not in path mode (@is_path = 1) we also consider      /* If we are not in path mode (@is_path = 1) we also consider
101         path separators as illegal chars. */         path separators as illegal chars. */
102      if (!is_path) {      if (!is_path && (strchr (fname, ':') || strchr (fname, '\\')))
103          if (strchr (fname, ':') || strchr (fname, '\\'))          return -1;
             return -1;  
     }  
104    
105      for (i=0; i < strlen (fname); i++) {      for (i=0; i < strlen (fname); i++) {
106          if (strchr (not_allowed, fname[i]))          if (strchr (not_allowed, fname[i]))

Legend:
Removed from v.273  
changed lines
  Added in v.278

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26