/[rdesktop]/sourceforge.net/trunk/rdesktop/rdesktop.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdesktop.c

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

revision 571 by n-ki, Wed Jan 21 18:17:20 2004 UTC revision 575 by n-ki, Thu Jan 22 09:03:06 2004 UTC
# Line 750  next_arg(char *src, char needle) Line 750  next_arg(char *src, char needle)
750  {  {
751          char *nextval;          char *nextval;
752          char *p;          char *p;
753            char *mvp = 0;
754    
755          // EOS          /* EOS */
756          if (*src == (char) 0x00)          if (*src == (char) 0x00)
757                  return 0;                  return 0;
758    
759          p = src;          p = src;
760          // skip escaped needles.          /*  skip escaped needles */
761          while( (nextval = strchr(p, needle) ) )          while( (nextval = strchr(p, needle) ) )
762          {          {
763                  if( *(nextval-1) != '\\' )                  mvp = nextval - 1;
764                    /* found backslashed needle */
765                    if( *mvp == '\\' && (mvp > src) )
766                    {
767                            /* move string one to the left */
768                            while( *(mvp+1) != (char)0x00 )
769                            {
770                                    *mvp = *(mvp+1);
771                                    *mvp++;
772                            }
773                            *mvp = (char)0x00;
774                            p = nextval;
775                    }
776                    else
777                    {
778                            p = nextval +1;
779                          break;                          break;
780                  p = nextval +1;                  }
781    
782          }          }
783    
784          // more args available          /* more args available */
785          if (nextval)          if (nextval)
786          {          {
787                  *nextval = (char) 0x00;                  *nextval = (char) 0x00;
788                  return ++nextval;                  return ++nextval;
789          }          }
790    
791          // no more args after this, jump to EOS          /* no more args after this, jump to EOS */
792          nextval = src + strlen(src);          nextval = src + strlen(src);
793          return nextval;          return nextval;
794  }  }

Legend:
Removed from v.571  
changed lines
  Added in v.575

  ViewVC Help
Powered by ViewVC 1.1.26