Skip to content

Commit 10e1667

Browse files
committed
There must be read_file
1 parent 21feae0 commit 10e1667

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/post/osx/gather/safari_lastsession.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_safari_version
4242

4343
f = read_file("/Applications/Safari.app/Contents/version.plist")
4444
xml = REXML::Document.new(f) rescue nil
45-
return version if xml.root.nil?
45+
return version if xml.nil?
4646

4747
xml.elements['plist/dict'].each_element do |e|
4848
if e.text == 'CFBundleShortVersionString'
@@ -66,7 +66,7 @@ def peer
6666
#
6767
def plutil(filename)
6868
cmd_exec("plutil -convert xml1 #{filename}")
69-
cmd_exec("cat #{filename}")
69+
read_file(filename)
7070
end
7171

7272

@@ -76,7 +76,7 @@ def plutil(filename)
7676
#
7777
def get_lastsession
7878
print_status("#{peer} - Looking for LastSession.plist")
79-
plutil("~/Library/Safari/LastSession.plist")
79+
plutil("#{expand_path("~")}/Library/Safari/LastSession.plist")
8080
end
8181

8282

@@ -89,7 +89,7 @@ def get_sessions(lastsession)
8989
session_dict = nil
9090

9191
xml = REXML::Document.new(lastsession) rescue nil
92-
return nil if xml.root.nil?
92+
return nil if xml.nil?
9393

9494
xml.elements['plist'].each_element do |e|
9595
found = false

0 commit comments

Comments
 (0)