Skip to content

Commit 959a79f

Browse files
authored
Merge pull request #19345 from hvitved/shared/file-system-append-join-fix
Shared: Fix join in `FileSystem.qll`
2 parents 97ca2af + ae5ac11 commit 959a79f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

shared/util/codeql/util/FileSystem.qll

+7-4
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ module Make<InputSig Input> {
239239
result = 0
240240
}
241241

242+
pragma[nomagic]
243+
private Container getAChildContainer(Container c, string baseName) {
244+
result = c.getAChildContainer() and
245+
baseName = result.getBaseName()
246+
}
247+
242248
pragma[nomagic]
243249
private Container appendStep(Folder f, string relativePath, int i) {
244250
i = -1 and
@@ -253,10 +259,7 @@ module Make<InputSig Input> {
253259
else
254260
if comp = "."
255261
then result = mid
256-
else (
257-
result = mid.getAChildContainer() and
258-
result.getBaseName() = comp
259-
)
262+
else result = getAChildContainer(mid, comp)
260263
)
261264
}
262265

0 commit comments

Comments
 (0)