|
Lines 70-75
void stripExtension( TQString *name )
Link Here
|
| 70 |
pos -= 4; |
70 |
pos -= 4; |
| 71 |
else if ( name->find(".bz", -3) != -1 ) |
71 |
else if ( name->find(".bz", -3) != -1 ) |
| 72 |
pos -= 3; |
72 |
pos -= 3; |
|
|
73 |
else if ( name->find(".xz", -3) != -1 ) |
| 74 |
pos -= 3; |
| 75 |
else if ( name->find(".lzma", -5) != -1 ) |
| 76 |
pos -= 5; |
| 73 |
|
77 |
|
| 74 |
if ( pos > 0 ) |
78 |
if ( pos > 0 ) |
| 75 |
pos = name->findRev('.', pos-1); |
79 |
pos = name->findRev('.', pos-1); |
|
Lines 476-488
void MANProtocol::get(const KURL& url )
Link Here
|
| 476 |
{ |
480 |
{ |
| 477 |
pageFound=false; |
481 |
pageFound=false; |
| 478 |
//check for the case that there is foo.1 and foo.1.gz found: |
482 |
//check for the case that there is foo.1 and foo.1.gz found: |
| 479 |
// ### TODO make it more generic (other extensions) |
483 |
if (foundPages.count()==2) { |
| 480 |
if ((foundPages.count()==2) && |
484 |
TQString foundPage0 = foundPages[0]; |
| 481 |
(((foundPages[0]+".gz") == foundPages[1]) || |
485 |
TQString foundPage1 = foundPages[1]; |
| 482 |
(foundPages[0] == (foundPages[1]+".gz")))) |
486 |
|
| 483 |
pageFound=true; |
487 |
stripExtension(&foundPage0); |
| 484 |
else |
488 |
stripExtension(&foundPage1); |
|
|
489 |
if(foundPage0 == foundPage1) { |
| 490 |
pageFound=true; |
| 491 |
} |
| 492 |
} |
| 493 |
if (!pageFound) { |
| 485 |
outputMatchingPages(foundPages); |
494 |
outputMatchingPages(foundPages); |
|
|
495 |
} |
| 486 |
} |
496 |
} |
| 487 |
//yes, we found exactly one man page |
497 |
//yes, we found exactly one man page |
| 488 |
|
498 |
|
|
Lines 1335-1340
void MANProtocol::showIndex(const TQString& section)
Link Here
|
| 1335 |
end -= 2; |
1345 |
end -= 2; |
| 1336 |
else if ( len >= 4 && strcmp( end-3, ".bz2" ) == 0 ) |
1346 |
else if ( len >= 4 && strcmp( end-3, ".bz2" ) == 0 ) |
| 1337 |
end -= 4; |
1347 |
end -= 4; |
|
|
1348 |
else if ( len >= 3 && strcmp( end-2, ".bz" ) == 0 ) |
| 1349 |
end -= 3; |
| 1350 |
else if ( len >= 3 && strcmp( end-2, ".xz" ) == 0 ) |
| 1351 |
end -= 3; |
| 1352 |
else if ( len >= 5 && strcmp( end-4, ".lzma" ) == 0 ) |
| 1353 |
end -= 5; |
| 1338 |
|
1354 |
|
| 1339 |
while ( end >= begin && *end != '.' ) |
1355 |
while ( end >= begin && *end != '.' ) |
| 1340 |
end--; |
1356 |
end--; |