[PATCH] avr: simplify some option parsing with strcasecmp ()
tbsaunde+binutils@tbsaunde.org
tbsaunde+binutils@tbsaunde.org
Sat Apr 2 17:54:00 GMT 2016
More information about the Binutils mailing list
Sat Apr 2 17:54:00 GMT 2016
- Previous message (by thread): Preventing preemption of 'protected' symbols in GNU ld 2.26
- Next message (by thread): [PATCH] avr: simplify some option parsing with strcasecmp ()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org> Hi, Instead of canonicalizing the argument we can just use a case insensitive compare. built and regtested a cross to avr-elf, ok? Trev gas/ChangeLog: 2016-04-02 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-avr.c (md_parse_option): Use strcasecmp () to compare strings. --- gas/config/tc-avr.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c index 852002f..999ffb4 100644 --- a/gas/config/tc-avr.c +++ b/gas/config/tc-avr.c @@ -562,22 +562,11 @@ md_parse_option (int c, const char *arg) case OPTION_MMCU: { int i; - char *s = xmalloc (strlen (arg) + 1); - - { - char *t = s; - const char *arg1 = arg; - - do - *t = TOLOWER (*arg1++); - while (*t++); - } for (i = 0; mcu_types[i].name; ++i) - if (strcmp (mcu_types[i].name, s) == 0) + if (strcasecmp (mcu_types[i].name, arg) == 0) break; - free (s); if (!mcu_types[i].name) { show_mcu_list (stderr); -- 2.1.4
- Previous message (by thread): Preventing preemption of 'protected' symbols in GNU ld 2.26
- Next message (by thread): [PATCH] avr: simplify some option parsing with strcasecmp ()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list