[Kst] kdeextragear-2/kst/kst/datasources/ascii
George Staikos
staikos at kde.org
Mon Apr 11 15:45:19 CEST 2005
CVS commit by staikos:
escape unescaped buffer
M +3 -3 ascii.cpp 1.45
--- kdeextragear-2/kst/kst/datasources/ascii/ascii.cpp #1.44:1.45
@@ -373,5 +373,5 @@ static QStringList fieldListFor(const QS
int cnt;
if (cfg->_columnType == AsciiSource::Config::Custom && !cfg->_columnDelimiter.isEmpty()) {
- cnt = QStringList::split(QRegExp(QString("[%1]").arg(cfg->_columnDelimiter)), line, false).count();
+ cnt = QStringList::split(QRegExp(QString("[%1]").arg(QRegExp::escape(cfg->_columnDelimiter))), line, false).count();
} else if (cfg->_columnType == AsciiSource::Config::Fixed) {
cnt = line.length() / cfg->_columnWidth;
@@ -579,6 +579,6 @@ int understands_ascii(KConfig *cfg, cons
QRegExp commentRE, dataRE;
if (config._columnType == AsciiSource::Config::Custom && !config._columnDelimiter.isEmpty()) {
- commentRE = QString("^[%1]*[%2].*").arg(config._columnDelimiter).arg(config._delimiters);
- dataRE = QString("^[%1]*(([Nn][Aa][Nn]|(\\-\\+)?[Ii][Nn][Ff]|[0-9\\+\\-\\.eE]+)[\\s]*)+").arg(config._columnDelimiter);
+ commentRE = QString("^[%1]*[%2].*").arg(QRegExp::escape(config._columnDelimiter)).arg(config._delimiters);
+ dataRE = QString("^[%1]*(([Nn][Aa][Nn]|(\\-\\+)?[Ii][Nn][Ff]|[0-9\\+\\-\\.eE]+)[\\s]*)+").arg(QRegExp::escape(config._columnDelimiter));
} else {
commentRE = QString("^\\s*[%1].*").arg(config._delimiters);
More information about the Kst
mailing list