Skip to content

Commit 8e727ef

Browse files
authored
Merge pull request #161 from jwillemsen/jwi-security
Fixed security warnings, replace also multiple * with basename for ea…
2 parents 409b4b3 + 97a540b commit 8e727ef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

brix11/lib/brix11/options.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def has_key?(k)
6767
def load(rcpath)
6868
log(3, "Loading #{BRIX11RC} from #{rcpath}")
6969
begin
70-
_cfg = JSON.parse(IO.read(rcpath))
70+
_cfg = JSON.parse(File.read(rcpath))
7171
rescue JSON::ParserError => ex
7272
log_fatal("Error parsing JSON file #{rcpath}: #{ex}")
7373
end

brix11/lib/brix11/project.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,13 @@ def list_mpc_projects(path)
290290
def parse_mpc_file(file)
291291
base_name = File.basename(file, '.*')
292292
ptable = {}
293-
IO.foreach(file) do |ln|
293+
File.foreach(file) do |ln|
294294
if /\A\s*project\s*\((.*)\)/ =~ ln
295295
convert = !ln.index('*').nil?
296296
prj = $1.strip.sub(/\A\*\Z/, base_name)
297297
prj.sub!(/\A\*/) { |_| base_name + '_' }
298298
prj.sub!(/\*\Z/) { |_| '_' + base_name }
299-
prj.sub!('*', "_#{base_name}_")
299+
prj.gsub!('*', "_#{base_name}_")
300300
prj.gsub!(/(\A|[^a-zA-Z0-9])?([a-zA-Z0-9])([a-zA-Z0-9]*)/) { |_| $1 + $2.upcase + $3 } if convert
301301
ptable[prj] = file
302302
end

0 commit comments

Comments
 (0)