Skip to content

Commit

Permalink
Merge pull request #12 from palmin/master
Browse files Browse the repository at this point in the history
safer way to skip leading \ in arg
  • Loading branch information
holzschu authored Jan 29, 2018
2 parents 4bdf262 + 91f056a commit 2e1555d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios_system.m
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,8 @@ int ios_system(const char* inputCmd) {
// The executable file has precedence, unless the user has specified they want the original
// version, by prefixing it with \. So "\ls" == always "our" ls. "ls" == maybe ~/Library/bin/ls
// (if it exists).
argv[0] = argv[0] + 1;
size_t len_with_terminator = strlen(argv[0] + 1) + 1;
memmove(argv[0], argv[0] + 1, len_with_terminator);
} else {
NSString* commandName = [NSString stringWithCString:argv[0]];
BOOL isDir = false;
Expand Down

0 comments on commit 2e1555d

Please sign in to comment.