Skip to content

Commit

Permalink
Don't create a sh session inside a sh session
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Holzschuch committed Jun 4, 2020
1 parent a245026 commit 9fc8f74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ios_system.m
Original file line number Diff line number Diff line change
Expand Up @@ -951,9 +951,11 @@ int sh_main(int argc, char** argv) {
}
NSFileManager *fileManager = [[NSFileManager alloc] init];
// NSLog(@"parentSession = %x currentSession = %x currentDir = %s\n", parentSession, currentSession, [fileManager currentDirectoryPath].UTF8String);
if (currentSession->context == sh_session) {
return 1; // We cannot have a sh command starting a sh command.
}
if (parentSession == NULL) {
if (currentSession->context != sh_session)
parentSession = currentSession;
parentSession = currentSession;
parentDir = [fileManager currentDirectoryPath];
}
ios_switchSession(&sh_session); // create a new session
Expand Down

0 comments on commit 9fc8f74

Please sign in to comment.