Skip to content

Commit

Permalink
Fix some paths not being escaped properly
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Jul 11, 2024
1 parent bd21188 commit 45b723b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/file_format/custom_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ like `base_path: build/ga{exam/ple}me/` is not valid, but
`base_path: build/{example}/game/`, `base_path: build/ga{example}me/`,
`target_path: build/{example}/game.{version}.elf` are valid.

All slinky paths support path replacement unless explicitely stated otherwise.

#### Example

Say we have a yaml file like the following:
Expand Down
2 changes: 1 addition & 1 deletion docs/file_format/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ as well.
## `base_path`

All the emitted paths are relative to this path. Useful when all the files are
relative to the same path, like a `build` folder.
relative to the same directory, like a `build` folder.

### Example

Expand Down
7 changes: 5 additions & 2 deletions slinky/src/linker_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,15 @@ impl LinkerWriter<'_> {
pub fn save_other_files(&self) -> Result<(), SlinkyError> {
if let Some(d_path) = &self.d.settings.d_path {
if let Some(target_path) = &self.d.settings.target_path {
self.export_dependencies_file_to_file(d_path, target_path)?;
self.export_dependencies_file_to_file(
&self.d.escape_path(d_path)?,
&self.d.escape_path(target_path)?,
)?;
}
}

if let Some(symbols_header_path) = &self.d.settings.symbols_header_path {
self.export_symbol_header_to_file(symbols_header_path)?;
self.export_symbol_header_to_file(&self.d.escape_path(symbols_header_path)?)?;
}

Ok(())
Expand Down

0 comments on commit 45b723b

Please sign in to comment.