- len = strlen(substr);
- for (; swp->sw; swp++) {
- /* null matches all strings */
- if (!*substr || (ssequal (substr, swp->sw) && len >= swp->minchars)) {
- optno = 0;
- /* next switch */
- if ((sp = (&swp[1])->sw)) {
- if (!*substr && sp[0] == 'n' && sp[1] == 'o' &&
- strcmp (&sp[2], swp->sw) == 0 && (
- ((&swp[1])->minchars == 0 && swp->minchars == 0) ||
- ((&swp[1])->minchars == (swp->minchars) + 2)))
- optno++;
- }
+ len = strlen(substr);
+ for (; swp->sw; swp++) {
+ /* null matches all strings */
+ if (!*substr || (strncmp(swp->sw, substr, len)==0 &&
+ len >= swp->minchars)) {
+ optno = 0;
+ /* next switch */
+ if ((sp = (&swp[1])->sw)) {
+ if (!*substr && sp[0] == 'n' && sp[1] == 'o' &&
+ strcmp(&sp[2], swp->sw) == 0 && (
+ ((&swp[1])->minchars == 0 && swp->minchars == 0) ||
+ ((&swp[1])->minchars == (swp->minchars) + 2)))
+ optno++;
+ }