commit 6294c9610e2b98de4908577558029173568f88c1
Author: Pavel Sanda <[email protected]>
Date:   Sun Oct 11 23:21:40 2026 +0200

    lyxpaperview: pass -- safeguard
    
    Nothing executes through this: plocate has no option that runs a
    command, but paths could be steered via --database.
    
    Tier 01 DiD / conv-args: -- separator for the lyxpaperview search pattern
    
    https://www.mail-archive.com/[email protected]/msg227025.html
    
    Assisted-by: Claude Opus 5
---
 lib/scripts/lyxpaperview.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/scripts/lyxpaperview.py b/lib/scripts/lyxpaperview.py
index 3e40a630d7..f7623f6f5a 100755
--- a/lib/scripts/lyxpaperview.py
+++ b/lib/scripts/lyxpaperview.py
@@ -60,13 +60,13 @@ def find(args, path):
     if os.name != 'nt':
         # use locate if possible (faster)
         if find_exe(['locate']):
-            p1 = subprocess.Popen(['locate', '-i', args[0].lower()], 
stdout=subprocess.PIPE)
-            px = subprocess.Popen(['grep', '-Ei', r'\.pdf$|\.ps$'], 
stdin=p1.stdout, stdout=subprocess.PIPE)
+            p1 = subprocess.Popen(['locate', '-i', '--', args[0].lower()], 
stdout=subprocess.PIPE)
+            px = subprocess.Popen(['grep', '-Ei', '--', r'\.pdf$|\.ps$'], 
stdin=p1.stdout, stdout=subprocess.PIPE)
             for arg in args:
                if arg == args[0]:
                    # have this already
                    continue
-               px = subprocess.Popen(['grep', '-i', arg], stdin=px.stdout, 
stdout=subprocess.PIPE)
+               px = subprocess.Popen(['grep', '-i', '--', arg], 
stdin=px.stdout, stdout=subprocess.PIPE)
             p1.stdout.close()
             output = px.communicate()
             return output[0].decode("utf8").strip('\n')
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to