| | 323 | /* strip dots from the end and spaces |
| | 324 | * |
| | 325 | * windows/dos handle those filenames as the same file |
| | 326 | * |
| | 327 | * foo == foo. == foo..... == "foo... " == "foo.. ./" |
| | 328 | * |
| | 329 | * This will affect in some cases PATHINFO |
| | 330 | * |
| | 331 | * */ |
| | 332 | if (con->physical.rel_path->used > 1) { |
| | 333 | buffer *b = con->physical.rel_path; |
| | 334 | size_t i; |
| | 335 | |
| | 336 | if (b->used > 2 && |
| | 337 | b->ptr[b->used-2] == '/' && |
| | 338 | (b->ptr[b->used-3] == ' ' || |
| | 339 | b->ptr[b->used-3] == '.')) { |
| | 340 | b->ptr[b->used--] = '\0'; |
| | 341 | } |
| | 342 | |
| | 343 | for (i = b->used - 2; b->used > 1; i--) { |
| | 344 | if (b->ptr[i] == ' ' || |
| | 345 | b->ptr[i] == '.') { |
| | 346 | b->ptr[b->used--] = '\0'; |
| | 347 | } else { |
| | 348 | break; |
| | 349 | } |
| | 350 | } |
| | 351 | } |
| | 352 | |