Replaced several strcmps by strcasecmps, fixes 1845811 Case sensitivity in shell

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@848 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Kolja Waschk 17 years ago
parent d1eb24adbf
commit cd7ea9388c

@ -7,6 +7,10 @@
patches from F. Rysanek, adding C5 stepping of PXA270 and a few
few functions that resolve the PXA270 address space into the 6
default nCS windows per 64MB. (Enhancement req. 1849493)
* cmd/part.c, cmd/setdevice.c, cmd/instruction.c, cmd/svf.c,
cmd/dr.c, cmd/initbus.c, cmd/test.c, part/part.c, libbrux/cmd/cmd.c,
libbrux/cmd/help.c: Make command string comparisons case-insensitive
(fixes 1845811 "Case sensitivity in shell")
2007-12-14 Kolja Waschk <kawk>

@ -38,7 +38,7 @@ cmd_run( char *params[] )
return 1;
for (i = 0; cmds[i]; i++)
if (strcmp( cmds[i]->name, params[0] ) == 0) {
if (strcasecmp( cmds[i]->name, params[0] ) == 0) {
int r = cmds[i]->run( params );
if (r < 0)
printf( _("%s: syntax error!\n"), params[0] );

@ -48,7 +48,7 @@ cmd_help_run( char *params[] )
/* search and print help for a particular command */
for (i = 0; cmds[i]; i++)
if (strcmp( cmds[i]->name, params[1] ) == 0) {
if (strcasecmp( cmds[i]->name, params[1] ) == 0) {
if (cmds[i]->help)
cmds[i]->help();
return 1;

@ -64,9 +64,9 @@ cmd_dr_run( char *params[] )
}
if (params[1]) {
if (strcmp( params[1], "in" ) == 0)
if (strcasecmp( params[1], "in" ) == 0)
dir = 0;
else if (strcmp( params[1], "out" ) == 0)
else if (strcasecmp( params[1], "out" ) == 0)
dir = 1;
else {
unsigned int bit;

@ -53,7 +53,7 @@ cmd_initbus_run( char *params[] )
}
for (i = 0; bus_drivers[i] != NULL; i++) {
if (strcmp( bus_drivers[i]->name, params[1] ) == 0) {
if (strcasecmp( bus_drivers[i]->name, params[1] ) == 0) {
bus_t *bus = bus_drivers[i]->new_bus();
if (bus == NULL) {
printf( _("bus initialization failed!\n") );

@ -62,7 +62,7 @@ cmd_instruction_run( char *params[] )
if (cmd_params( params ) == 3) {
unsigned int len;
if (strcmp( params[1], "length" ) != 0)
if (strcasecmp( params[1], "length" ) != 0)
return -1;
if (part->instructions != NULL) {

@ -68,7 +68,7 @@ part_t *part;
for(i=0;i<chain->parts->len;i++) {
a = chain->parts->parts[i]->alias;
if(a && strcmp(a,params[1]) == 0)break;
if(a && strcasecmp(a,params[1]) == 0)break;
}
if(i < chain->parts->len)n = i;

@ -38,7 +38,7 @@ static int cmd_setdevice_run( char *params[] )
{
if(cmd_params(params) != 2)
return -1;
if (strcmp( params[1], "sharc21065L" ) == 0)
if (strcasecmp( params[1], "sharc21065L" ) == 0)
{
#if 0
buses_free();

@ -42,7 +42,7 @@ cmd_svf_run( char *params[] )
if ((SVF_FILE = fopen(params[1], "r")) != NULL) {
if (num_params == 3) {
if (strcmp(params[2], "stop") == 0) {
if (strcasecmp(params[2], "stop") == 0) {
svf_run(SVF_FILE, 1);
result = 1;
}

@ -44,7 +44,7 @@ cmd_test_run( char *params[] )
if (cmd_params( params ) != 4)
return -1;
if (strcmp( params[1], "signal") != 0)
if (strcasecmp( params[1], "signal") != 0)
return -1;
if (!cmd_test_cable())

@ -150,14 +150,14 @@ part_find_signal( part_t *p, const char *signalname )
s = p->signals;
while (s) {
if (strcmp( signalname, s->name ) == 0)
if (strcasecmp( signalname, s->name ) == 0)
return s;
s = s->next;
}
sa = p->saliases;
while (sa) {
if (strcmp( signalname, sa->name ) == 0)
if (strcasecmp( signalname, sa->name ) == 0)
return sa->signal;
sa = sa->next;
}

Loading…
Cancel
Save