mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
avr: simplify some option parsing with strcasecmp ()
Instead of canonicalizing the argument we can just use a case insensitive compare. gas/ChangeLog: 2016-04-03 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-avr.c (md_parse_option): Use strcasecmp () to compare strings.
This commit is contained in:
parent
d0a9981f37
commit
f73e41ef37
@ -1,3 +1,8 @@
|
||||
2016-04-03 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
|
||||
|
||||
* config/tc-avr.c (md_parse_option): Use strcasecmp () to compare
|
||||
strings.
|
||||
|
||||
2016-04-02 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 19896
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user