projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
197cf9c
)
commands containing multiple slashes are no longer treated like a separate command...
author
Marcus Eggenberger
<egs@quassel-irc.org>
Sun, 27 Jul 2008 22:29:32 +0000
(
00:29
+0200)
committer
Marcus Eggenberger
<egs@quassel-irc.org>
Sun, 27 Jul 2008 22:30:38 +0000
(
00:30
+0200)
src/core/userinputhandler.cpp
patch
|
blob
|
history
diff --git
a/src/core/userinputhandler.cpp
b/src/core/userinputhandler.cpp
index
deddc92
..
0c2c042
100644
(file)
--- a/
src/core/userinputhandler.cpp
+++ b/
src/core/userinputhandler.cpp
@@
-37,7
+37,10
@@
void UserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const QStri
return;
QString cmd;
QString msg = msg_;
return;
QString cmd;
QString msg = msg_;
- if(!msg.startsWith('/')) {
+ // leading slashes indicate there's a command to call unless there is anothere one in the first section (like a path /proc/cpuinfo)
+ int secondSlashPos = msg.indexOf('/', 1);
+ int firstSpacePos = msg.indexOf(' ');
+ if(!msg.startsWith('/') || (secondSlashPos != -1 && (secondSlashPos < firstSpacePos || firstSpacePos == -1))) {
cmd = QString("SAY");
} else {
cmd = msg.section(' ', 0, 0).remove(0, 1).toUpper();
cmd = QString("SAY");
} else {
cmd = msg.section(' ', 0, 0).remove(0, 1).toUpper();