Skip to content

Commit 6b48fff

Browse files
committed
Merge remote-tracking branch 'dckc/find-mod-grandparent' into ag-linux-cli
2 parents f690418 + 1e807cd commit 6b48fff

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

xs/sources/xsPlatforms.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ txID fxFindModule(txMachine* the, txSlot* realm, txID moduleID, txSlot* slot)
182182
relative = 1;
183183
}
184184
else if ((name[0] == '.') && (name[1] == '.') && (name[2] == '/')) {
185-
dot = 2;
185+
if ((name[3] == '.') && (name[4] == '.') && (name[5] == '/')) {
186+
dot = 5;
187+
} else {
188+
dot = 2;
189+
}
186190
relative = 1;
187191
}
188192
#if mxWindows
@@ -225,11 +229,17 @@ txID fxFindModule(txMachine* the, txSlot* realm, txID moduleID, txSlot* slot)
225229
return XS_NO_ID;
226230
if (dot == 0)
227231
slash++;
228-
else if (dot == 2) {
232+
else if (dot > 1) {
229233
*slash = 0;
230234
slash = c_strrchr(path, mxSeparator);
231235
if (!slash)
232236
return XS_NO_ID;
237+
if (dot > 2) {
238+
*slash = 0;
239+
slash = c_strrchr(path, mxSeparator);
240+
if (!slash)
241+
return XS_NO_ID;
242+
}
233243
}
234244
if (preparation) {
235245
if (!c_strncmp(path, preparation->base, preparation->baseLength)) {

0 commit comments

Comments
 (0)