Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, October 15, 2026

Diff for libplaton/platon/str/strplus.c between version 1.14 and 1.15

version 1.14, 2002/02/28 15:46:17 version 1.15, 2002/02/28 16:37:46
Line 54  stristr(s1, s2)
Line 54  stristr(s1, s2)
   
 #endif  #endif
   
 /* str_white_str() by Rastislav 'Crasher' Barlik <rbarlik@yahoo.com> */  
         char *          char *
 str_white_str(str, substr, size)  str_white_str(str, substr, size)
         char *str;          char *str;
Line 82  str_white_str(str, substr, size)
Line 81  str_white_str(str, substr, size)
                 /* Find start of pattern in string. */                  /* Find start of pattern in string. */
                 while (*start != *substr) {                  while (*start != *substr) {
   
                         if (isspace(*start) && isspace(*substr))                          if ((isspace(*start)) && (isspace(*substr)))
                                 break;                                  break;
   
                         start++;                          start++;
Line 96  str_white_str(str, substr, size)
Line 95  str_white_str(str, substr, size)
                 sptr = start;                  sptr = start;
                 pptr = substr;                  pptr = substr;
   
                 //while (*sptr == *pptr || (isspace(sptr) && isspace(pptr))) {  
                 while (1) {                  while (1) {
                         if (! isspace(*sptr)) {  
                                 while (*sptr == *pptr) {  
                                         sptr++;  
                                         pptr++;  
                                         ssize++;  
                                 }  
                         }  
                         else {  
   
   #ifdef DEBUG /* if str_white_str() works properly, delete this */
                           printf("comparing %d [%s] with %d [%s]\n",
                                           *sptr, sptr, *pptr, pptr);
   #endif
   
                           if ((isspace(*sptr)) && (isspace(*pptr))) {
                                 while (isspace(*sptr)) {                                  while (isspace(*sptr)) {
                                         ++sptr;                                          ++sptr;
   
Line 118  str_white_str(str, substr, size)
Line 114  str_white_str(str, substr, size)
                                                 ++ssize;                                                  ++ssize;
                                 }                                  }
                         }                          }
                           else if (*sptr == *pptr) {
                                   while (*sptr == *pptr && *sptr != '\0' && ! isspace(*sptr)) {
                                           sptr++;
                                           pptr++;
                                           ssize++;
                                   }
                           }
                           else {
                                   break;
                           }
   
                         /* If end of pattern then pattern was found. */                          /* If end of pattern then pattern was found. */
                         if (*pptr == '\0') {                          if (*pptr == '\0') {

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top