mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
Userland: cat no longer tries to open "cat"
I made the mistake of starting the initial for loop at i=0 when it should have started at 1. argv[0] is the program name, argv[1] is an argument.
This commit is contained in:
parent
7c71040ba9
commit
b583f21e27
Notes:
sideshowbarker
2024-07-19 11:29:46 +09:00
Author: https://github.com/balatt Commit: https://github.com/SerenityOS/serenity/commit/b583f21e277 Pull-request: https://github.com/SerenityOS/serenity/pull/705
@ -11,7 +11,7 @@ int main(int argc, char** argv)
|
||||
{
|
||||
Vector<int> fds;
|
||||
if (argc > 1) {
|
||||
for (int i = 0; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
int fd;
|
||||
if ((fd = open(argv[i], O_RDONLY)) == -1) {
|
||||
fprintf(stderr, "Failed to open %s: %s\n", argv[i], strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user