Skip to content

Commit 7d6ec03

Browse files
committed
If a short-path cannot be created, fallback to absolute path, even though it's more verbose.
1 parent 43618c8 commit 7d6ec03

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/cmock_config.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ def initialize(options = nil)
8181
require 'pathname'
8282
includes1 = options[:includes_c_post_header] || []
8383
includes2 = options[:unity_helper_path].map do |path|
84-
Pathname(File.expand_path(path)).relative_path_from(Pathname(File.expand_path(options[:mock_path]))).to_s
84+
begin
85+
Pathname(File.expand_path(path)).relative_path_from(Pathname(File.expand_path(options[:mock_path]))).to_s
86+
rescue
87+
path
88+
end
8589
end
8690
options[:includes_c_post_header] = (includes1 + includes2).uniq
8791
end

0 commit comments

Comments
 (0)