An bug in all the DC++ version! (not an big bug)
Moderator: Moderators
An bug in all the DC++ version! (not an big bug)
As you see when i click on "Status" te files should be order by "Running" "User online" ... but you see 30 is bigger than 9. why are 9 downer? thats because dc++ is seeing 30 as 3 and 9 as 9... Plis fix it to the next version of dc++
If the DC++ coding crew have problems to find out how, just take an 0 before 9
Sorry my bad english
-
- Forum Moderator
- Posts: 1420
- Joined: 2003-04-22 14:37
It's not a bug, and if it were, it's not specific to DC++. That line is text and it is sorted alpabetically. Hence "30" comes before "9". Your workaround to "help" is a hack, at best. What happens if a number more than 99 is needed? Do you just keep on adding zeroes?
As far as I know there is no simple (and efficient) way to do mix and match sorting. I wouldn't hold my breath if I were you.
As far as I know there is no simple (and efficient) way to do mix and match sorting. I wouldn't hold my breath if I were you.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
When XP changed the sorting behavior, it was an enhancement. They call it "Natural Sort Order" or something similar.
[quote="ESR"]Don't claim that you have found a bug
When you are having problems with a piece of software, don't claim you have found a bug unless you are very, very sure of your ground. Hint: unless you can provide a source-code patch that fixes the problem, or a regression test against a previous version that demonstrates incorrect behavior, you are probably not sure enough.
Remember, there are a lot of other users that are not experiencing your problem. Otherwise you would have learned about it while reading the documentation and searching the Web (you did do that before complaining, didn't you?). This means that very probably it is you who are doing something wrong, not the software.
The people who wrote the software work very hard to make it work as well as possible. If you claim you have found a bug, you'll be implying that they did something wrong, and you will almost always offend them â€â€
[quote="ESR"]Don't claim that you have found a bug
When you are having problems with a piece of software, don't claim you have found a bug unless you are very, very sure of your ground. Hint: unless you can provide a source-code patch that fixes the problem, or a regression test against a previous version that demonstrates incorrect behavior, you are probably not sure enough.
Remember, there are a lot of other users that are not experiencing your problem. Otherwise you would have learned about it while reading the documentation and searching the Web (you did do that before complaining, didn't you?). This means that very probably it is you who are doing something wrong, not the software.
The people who wrote the software work very hard to make it work as well as possible. If you claim you have found a bug, you'll be implying that they did something wrong, and you will almost always offend them â€â€
here's something i quickly wipped up as a replacement to stricmp. still needs some testing though
Code: Select all
static bool isNumeric(char c) {
return (c >= '0' && c <= '9') ? true : false;
}
static int natstricmp(const char *a, const char* b) {
int v1, v2;
while(*a != 0 && *b != 0) {
v1 = 0; v2 = 0;
bool t1 = isNumeric(*a);
bool t2 = isNumeric(*b);
if(t1 != t2) return (t1) ? -1 : 1;
if(!t1) { //string
if(cmpi[(u_int8_t)*a][(u_int8_t)*b] != 0)
return cmpi[(u_int8_t)*a][(u_int8_t)*b];
a++; b++;
} else { // number
while(isNumeric(*a)) {
v1 *= 10;
v1 += *a - '0';
a++;
}
while(isNumeric(*b)) {
v2 *= 10;
v2 += *b - '0';
b++;
}
if(v1 != v2)
return (v1 < v2) ? -1 : 1;
}
}
return cmpi[(u_int8_t)*a][(u_int8_t)*b];
}
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
-
- Forum Moderator
- Posts: 366
- Joined: 2004-03-06 02:46
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
It is a performance hit, though, so if other means are available, it'd make sense to use them.Twink wrote:yes but it would make sense to add it to other things too, I can see it being quite good for filelists.
If you've tested your code and think it's a good idea, package it up and send it to arnetheduck - I only make and send in patches for code I know people want contributed.