From 7d6ec0354a4087605ac865d5876f90f6fb9781ac Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Wed, 23 Oct 2024 15:35:37 -0400 Subject: [PATCH] If a short-path cannot be created, fallback to absolute path, even though it's more verbose. --- lib/cmock_config.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cmock_config.rb b/lib/cmock_config.rb index c1b495f..1b3acfd 100644 --- a/lib/cmock_config.rb +++ b/lib/cmock_config.rb @@ -81,7 +81,11 @@ class CMockConfig require 'pathname' includes1 = options[:includes_c_post_header] || [] includes2 = options[:unity_helper_path].map do |path| - Pathname(File.expand_path(path)).relative_path_from(Pathname(File.expand_path(options[:mock_path]))).to_s + begin + Pathname(File.expand_path(path)).relative_path_from(Pathname(File.expand_path(options[:mock_path]))).to_s + rescue + path + end end options[:includes_c_post_header] = (includes1 + includes2).uniq end