mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: check if the dollar sign is used for command in KShellTest::envExpand()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
b5c25aa63b
commit
af07c63a89
2 changed files with 5 additions and 1 deletions
|
@ -60,6 +60,8 @@ KShellTest::envExpand()
|
|||
QCOMPARE(KShell::envExpand("${HOME}/${LOGNAME}"), QString(QDir::homePath()+"/" + me));
|
||||
QCOMPARE(KShell::envExpand("\\${HOME}/${LOGNAME}"), QString("\\${HOME}/" + me));
|
||||
QCOMPARE(KShell::envExpand("${HOME}/\\${LOGNAME}"), QString(QDir::homePath()+"/\\${LOGNAME}"));
|
||||
|
||||
QCOMPARE(KShell::envExpand("$(hostname)"), QString("$(hostname)"));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -79,7 +79,9 @@ QString KShell::envExpand( const QString &fname )
|
|||
QString result = fname;
|
||||
int i = 0;
|
||||
while (i < result.size()) {
|
||||
if (result.at(i) == QLatin1Char('$') && result[i - 1] != QLatin1Char('\\')) {
|
||||
if (result.at(i) == QLatin1Char('$')
|
||||
&& result[i - 1] != QLatin1Char('\\')
|
||||
&& result[i + 1] != QLatin1Char('(')) {
|
||||
int varstart = i + 1;
|
||||
int varend = varstart;
|
||||
int varlen = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue