Skip to content

Commit

Permalink
Merge branch 'release-0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-weis committed Dec 22, 2024
2 parents b5fc489 + d3f6a3c commit aea1653
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
### Security

## [0.7.0] - 2024-12-22

### Fixed

* Path separators are now properly handled for non-Windows targets.

## [0.6.0] - 2024-12-19

### Fixed
Expand Down Expand Up @@ -112,7 +118,8 @@ Non-breaking changes:
- VBA project parser.
- RLE decompressor for compressed streams.

[Unreleased]: https://github.com/tim-weis/ovba/compare/0.6.0...HEAD
[Unreleased]: https://github.com/tim-weis/ovba/compare/0.7.0...HEAD
[0.7.0]: https://github.com/tim-weis/ovba/compare/0.6.0...0.7.0
[0.6.0]: https://github.com/tim-weis/ovba/compare/0.5.0...0.6.0
[0.5.0]: https://github.com/tim-weis/ovba/compare/0.4.1...0.5.0
[0.4.1]: https://github.com/tim-weis/ovba/compare/0.4.0...0.4.1
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ovba"
version = "0.6.0"
version = "0.7.0"
authors = ["Tim Weis <tim.weis@outlook.com>"]
description = "An Office VBA project parser written in 100% safe Rust."
edition = "2018"
Expand Down
11 changes: 9 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,11 @@ impl Project {
.find(|&module| module.name == name)
.ok_or_else(|| Error::ModuleNotFound(name.to_owned()))?;

let path = format!("/VBA\\{}", &module.stream_name);
let path = if cfg!(windows) {
format!("/VBA\\{}", &module.stream_name)
} else {
format!("/VBA/{}", &module.stream_name)
};
let offset = module.text_offset;
let src_code = self.decompress_stream_from(path, offset)?;

Expand Down Expand Up @@ -347,7 +351,10 @@ pub fn open_project(raw: Vec<u8>) -> Result<Project> {
let mut container = CompoundFile::open(cursor).map_err(Error::Cfb)?;

// Read *dir* stream
const DIR_STREAM_PATH: &str = r#"/VBA\dir"#;
#[cfg(target_family = "windows")]
const DIR_STREAM_PATH: &str = "/VBA\\dir";
#[cfg(not(target_family = "windows"))]
const DIR_STREAM_PATH: &str = "/VBA/dir";

let mut buffer = Vec::new();
container
Expand Down

0 comments on commit aea1653

Please sign in to comment.