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
A quick test says you're right.. strange no one had noticed before. Patch applied to HEAD, will backport if no problems appear.
CVS commit by dagerbo: Fix bug #77278. Patch by Michal Ceresna. CCMAIL: 77278-done@bugs.kde.org M +5 -1 grepviewwidget.cpp 1.30 --- kdevelop/parts/grepview/grepviewwidget.cpp #1.29:1.30 @@ -196,4 +196,8 @@ void GrepViewWidget::searchActivated() command += "| grep -v \"CVS/\" "; } + + // quote spaces in filenames going to xargs + command += "| sed \"s/ /\\\\\\ /g\" "; + command += "| xargs " ; @@ -240,5 +244,5 @@ void GrepViewWidget::slotExecuted(QListB GrepListBoxItem *gi = static_cast<GrepListBoxItem*>(i); m_part->partController()->editDocument( KURL( gi->filename() ), gi->linenumber()-1 ); - m_part->mainWindow()->lowerView(this); +// m_part->mainWindow()->lowerView(this); }
CVS commit by dagerbo: Fix bug #77278. Patch by Michal Ceresna. CCMAIL: 77278@bugs.kde.org M +6 -2 grepviewwidget.cpp 1.25.2.3 --- kdevelop/parts/grepview/grepviewwidget.cpp #1.25.2.2:1.25.2.3 @@ -196,4 +196,8 @@ void GrepViewWidget::searchActivated() command += "| grep -v \"CVS/\" "; } + + // quote spaces in filenames going to xargs + command += "| sed \"s/ /\\\\\\ /g\" "; + command += "| xargs " ; @@ -239,6 +243,6 @@ void GrepViewWidget::slotExecuted(QListB GrepListBoxItem *gi = static_cast<GrepListBoxItem*>(i); - m_part->partController()->editDocument( gi->filename(), gi->linenumber()-1 ); - m_part->mainWindow()->lowerView(this); + m_part->partController()->editDocument( KURL( gi->filename() ), gi->linenumber()-1 ); +// m_part->mainWindow()->lowerView(this); }