Skip to content

Commit

Permalink
Fix duplicate Syslinux entries (2)
Browse files Browse the repository at this point in the history
Commit f0e3c93 changed open mode to "r+", but this mode does not create
missing files.

Revert open mode back to "a+" and add seek to beginning of the file.
  • Loading branch information
woky committed Feb 19, 2020
1 parent 99ecee2 commit 480b974
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion grml2usb
Expand Up @@ -1323,7 +1323,8 @@ def add_entry_if_not_present(filename, entry):
@filename: name of the file
@entry: data to write to the file
"""
data = open(filename, "r+")
data = open(filename, "a+")
data.seek(0)
for line in data:
if line == entry:
break
Expand Down

0 comments on commit 480b974

Please sign in to comment.