[Bug 77278] New: grep component fails to search with spaces in path

Michal Ceresna ceresna at amos.sturak.sk
Thu Mar 11 13:02:03 UTC 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=77278      
           Summary: grep component fails to search with spaces in path
           Product: kdevelop
           Version: 3.0.1
          Platform: Debian testing
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kdevelop-devel kdevelop org
        ReportedBy: ceresna amos sturak sk


Version:           3.0.1 (using KDE KDE 3.1.5)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc version 3.3.3 (Debian) 
OS:          Linux

when running grep in a directory which has spaces in path errors occur
e.g. for /home/ceresna/te st1/test2:

st1/test2: No such file or directory
st1/test2: No such file or directory
st1/test2: No such file or directory

 
this patch solves the problem:

--- kdevelop3-3.0.1.orig/parts/grepview/grepviewwidget.cpp      2004-01-27 23:30:59.000000000 +0100
+++ kdevelop3-3.0.1/parts/grepview/grepviewwidget.cpp   2004-03-10 10:39:40.000000000 +0100
 @ -205,6 +205,10  @
         command += "| grep -v \"SCCS/\" ";
         command += "| grep -v \"CVS/\" ";
     }
+
+    // quote spaces in filenames going to xargs
+    command += "| sed \"s/ /\\\\\\ /g\" ";
+
     command += "| xargs " ;

 #ifndef USE_SOLARIS




More information about the KDevelop-devel mailing list