Skip to content

Commit

Permalink
update shell
Browse files Browse the repository at this point in the history
Signed-off-by: Seonghyun Kim <[email protected]>
  • Loading branch information
ksh8281 committed Jun 30, 2023
1 parent f57b654 commit 6216708
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/shell/Shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,14 @@ class ShellPlatform : public PlatformRef {
virtual void didLoadModule(ContextRef* relatedContext, OptionalRef<ScriptRef> referrer, ScriptRef* loadedModule) override
{
std::string path;
if (referrer && loadedModule->src()->length() && loadedModule->src()->charAt(0) != '/') {
bool isAbs = false;
if (loadedModule->src()->length() && loadedModule->src()->charAt(0) == '/') {
isAbs = true;
} else if (loadedModule->src()->length() > 3 && loadedModule->src()->charAt(1) == ':' && loadedModule->src()->charAt(2) == '\\') {
isAbs = true;
}

if (referrer && loadedModule->src()->length() && !isAbs) {
path = absolutePath(referrer->src()->toStdUTF8String(), loadedModule->src()->toStdUTF8String());
} else {
path = absolutePath(loadedModule->src()->toStdUTF8String());
Expand Down

0 comments on commit 6216708

Please sign in to comment.