Previously it was possible to specify e.g. -q<lib> and still link with lib. Avoid such behaviour by checking for '-l' instead of '-l.'
Unified · Split
| @@ -474,7 +474,7 @@ int main(int argc, char **argv) · 473 unmodified lines | |||
| 474 | const char *filename; | 474 | const char *filename; |
| 475 | 475 | ||
| 476 | filename = files[i]; | 476 | filename = files[i]; |
| 477 | if (filename[0] == '-' && filename[1]) { | 477 | if (filename[0] == '-' && filename[1] == 'l') { |
| 478 | if (tcc_add_library(s, filename + 2) < 0) { | 478 | if (tcc_add_library(s, filename + 2) < 0) { |
| 479 | error_noabort("cannot find %s", filename); | 479 | error_noabort("cannot find %s", filename); |
| 480 | ret = 1; | 480 | ret = 1; |