|
a/libupnpp/upnpplib.cxx |
|
b/libupnpp/upnpplib.cxx |
|
... |
|
... |
416 |
} else {
|
416 |
} else {
|
417 |
return false;
|
417 |
return false;
|
418 |
}
|
418 |
}
|
419 |
return true;
|
419 |
return true;
|
420 |
}
|
420 |
}
|
|
|
421 |
|
|
|
422 |
#include <ctype.h>
|
|
|
423 |
|
|
|
424 |
// s1 is already uppercase
|
|
|
425 |
int stringuppercmp(const string & s1, const string& s2)
|
|
|
426 |
{
|
|
|
427 |
string::const_iterator it1 = s1.begin();
|
|
|
428 |
string::const_iterator it2 = s2.begin();
|
|
|
429 |
int size1 = s1.length(), size2 = s2.length();
|
|
|
430 |
char c2;
|
|
|
431 |
|
|
|
432 |
if (size1 > size2) {
|
|
|
433 |
while (it1 != s1.end()) {
|
|
|
434 |
c2 = ::toupper(*it2);
|
|
|
435 |
if (*it1 != c2) {
|
|
|
436 |
return *it1 > c2 ? 1 : -1;
|
|
|
437 |
}
|
|
|
438 |
++it1; ++it2;
|
|
|
439 |
}
|
|
|
440 |
return size1 == size2 ? 0 : 1;
|
|
|
441 |
} else {
|
|
|
442 |
while (it2 != s2.end()) {
|
|
|
443 |
c2 = ::toupper(*it2);
|
|
|
444 |
if (*it1 != c2) {
|
|
|
445 |
return *it1 > c2 ? 1 : -1;
|
|
|
446 |
}
|
|
|
447 |
++it1; ++it2;
|
|
|
448 |
}
|
|
|
449 |
return size1 == size2 ? 0 : -1;
|
|
|
450 |
}
|
|
|
451 |
}
|