]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
contrib/mklog.py: Fix writing to a global variable
authorFilip Kastl <fkastl@suse.cz>
Sun, 29 Jun 2025 08:16:35 +0000 (10:16 +0200)
committerFilip Kastl <fkastl@suse.cz>
Sun, 29 Jun 2025 08:16:35 +0000 (10:16 +0200)
The last patch of mklog.py put top-level code into function 'main()'.
Because of this, writing to global variable 'root' has to be preceded by
explicitly declaring 'root' as global.  Otherwise the write only has a
local effect.

Without this change, the '-d' cmdline flag would be broken.

Commited as obvious.

contrib/ChangeLog:

* mklog.py: In 'main()', specify variable 'root' as global.

Signed-off-by: Filip Kastl <fkastl@suse.cz>
contrib/mklog.py

index 26d4156b0340c77c6207467d0a32cfaf9115c798..b841ef0ae97e21584beab7bb96c227e1dd7618c3 100755 (executable)
@@ -389,6 +389,7 @@ def main():
     if args.input == '-':
         args.input = None
     if args.directory:
+        global root
         root = args.directory
 
     data = open(args.input, newline='\n') if args.input else sys.stdin