]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
scripts: Fix reading list of files in mock-noinline.py
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 28 Apr 2025 11:37:43 +0000 (13:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 28 Apr 2025 12:35:29 +0000 (14:35 +0200)
The mock-noinline.py script is fed list of files through its
stdin, each file on its own line. Unfortunately, the way the
script is written does nothing as the trailing newline character
prevents any .endswith() match. Strip each line of white spaces.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
scripts/mock-noinline.py

index ec617bbc2ba5e5268c2297c4fe89e2bde489f480..77a5ca23e2b576a2069e5bf1b8fa9b735d65dacb 100755 (executable)
@@ -63,7 +63,8 @@ def scan_overrides(filename):
                     mocked[name] = "%s:%d" % (filename, lineno)
 
 
-for filename in sys.stdin.readlines():
+for filename in sys.stdin:
+    filename = filename.rstrip()
     if filename.endswith(".h"):
         scan_annotations(filename)
     elif filename.endswith("mock.c"):