Help - Search - Members - Calendar
Full Version: find_first, find_last does not work
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Support - (fb2k)
Messer
In string.cpp:
CODE
int string8::find_first(const char * str,int start)
{
  unsigned n;
  if (start<0) start=0;
  for(n=start;n<used;n++)
  {
     if (!strcmp(data.get_ptr()+n,str)) return n;
  }
  return -1;
}


It'll find substring in string only if it is placed at the end of the string.
Same in find_last(const char*,int)...
Peter
Fixed, thanks.
You can correct it by replacing strcmp() with strcmp_partial() (implemented in string.cpp).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.