comparison lib-src/getopt.c @ 25980:cef61b080859

Avoid strneq.
author Dave Love <fx@gnu.org>
date Mon, 11 Oct 1999 17:14:12 +0000
parents 1a697e2604c3
children 134b57acef68
comparison
equal deleted inserted replaced
25979:e1d167cf6e96 25980:cef61b080859
650 /* Do nothing. */ ; 650 /* Do nothing. */ ;
651 651
652 /* Test all long options for either exact match 652 /* Test all long options for either exact match
653 or abbreviated matches. */ 653 or abbreviated matches. */
654 for (p = longopts, option_index = 0; p->name; p++, option_index++) 654 for (p = longopts, option_index = 0; p->name; p++, option_index++)
655 if (strneq (p->name, nextchar, nameend - nextchar)) 655 if (!strncmp (p->name, nextchar, nameend - nextchar))
656 { 656 {
657 if ((unsigned int) (nameend - nextchar) 657 if ((unsigned int) (nameend - nextchar)
658 == (unsigned int) strlen (p->name)) 658 == (unsigned int) strlen (p->name))
659 { 659 {
660 /* Exact match found. */ 660 /* Exact match found. */
837 /* Do nothing. */ ; 837 /* Do nothing. */ ;
838 838
839 /* Test all long options for either exact match 839 /* Test all long options for either exact match
840 or abbreviated matches. */ 840 or abbreviated matches. */
841 for (p = longopts, option_index = 0; p->name; p++, option_index++) 841 for (p = longopts, option_index = 0; p->name; p++, option_index++)
842 if (strneq (p->name, nextchar, nameend - nextchar)) 842 if (!strncmp (p->name, nextchar, nameend - nextchar))
843 { 843 {
844 if ((unsigned int) (nameend - nextchar) == strlen (p->name)) 844 if ((unsigned int) (nameend - nextchar) == strlen (p->name))
845 { 845 {
846 /* Exact match found. */ 846 /* Exact match found. */
847 pfound = p; 847 pfound = p;