Skip to content

qdl: fix absolute image_path handling in sahara_config#198

Merged
andersson merged 2 commits intolinux-msm:masterfrom
MrCry0:fix/windows-abs-path
Mar 25, 2026
Merged

qdl: fix absolute image_path handling in sahara_config#198
andersson merged 2 commits intolinux-msm:masterfrom
MrCry0:fix/windows-abs-path

Conversation

@MrCry0
Copy link
Copy Markdown
Contributor

@MrCry0 MrCry0 commented Mar 13, 2026

This PR addresses the issue #191

When image_path in a sahara_config XML is a Windows absolute path (e.g. "C:\programmer.elf"), it was incorrectly prefixed with the XML file's base directory, producing a broken path like "./C:\programmer.elf".

Guard the Windows-specific absolute path handling with _WIN32 so that Linux behaviour is unchanged.

Comment thread qdl.c Outdated
@MrCry0 MrCry0 force-pushed the fix/windows-abs-path branch from fe014c0 to df17929 Compare March 16, 2026 20:13
MrCry0 added 2 commits March 16, 2026 22:16
Add a cross-platform helper to test whether a path is absolute.
On POSIX, a path starting with '/' is absolute. On Windows,
absolute paths are either drive-letter paths (e.g. "C:\...") or
UNC paths (e.g. "\\server\share").

Signed-off-by: Oleksandr Suvorov <cryosay@gmail.com>
Absolute image_path values in sahara_config XML were incorrectly
treated as relative and prefixed with the XML file's base directory.
For example, a Windows path "C:\programmer.elf" would become
"./C:\programmer.elf".

Use path_is_absolute() to detect and use absolute paths as-is,
covering Windows drive-letter (e.g. "C:\...") and UNC paths
(e.g. "\\server\share"), as well as POSIX paths starting with '/'.

Signed-off-by: Oleksandr Suvorov <cryosay@gmail.com>
@MrCry0 MrCry0 force-pushed the fix/windows-abs-path branch from df17929 to 3fbe72e Compare March 16, 2026 20:17
@MrCry0 MrCry0 changed the title RFC: qdl: fix absolute Windows paths in sahara_config XML qdl: fix absolute image_path handling in sahara_config Mar 16, 2026
@igoropaniuk
Copy link
Copy Markdown
Contributor

LGTM

@andersson andersson merged commit ff27e82 into linux-msm:master Mar 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants