aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/predictive.cpp
diff options
context:
space:
mode:
authorGregory Montoir2007-02-13 21:06:57 +0000
committerGregory Montoir2007-02-13 21:06:57 +0000
commit1ce912e1063ae297407b4a9dfd5f30d4819eb284 (patch)
treea60c5b02027b991908299884d60ada4d014a9b2c /engines/agi/predictive.cpp
parent474d49dc146876b773bfef80335b740d1b1fa8a7 (diff)
downloadscummvm-rg350-1ce912e1063ae297407b4a9dfd5f30d4819eb284.tar.gz
scummvm-rg350-1ce912e1063ae297407b4a9dfd5f30d4819eb284.tar.bz2
scummvm-rg350-1ce912e1063ae297407b4a9dfd5f30d4819eb284.zip
made rtrim() and ltrim() global functions, to reduce code duplication (it seems parallaction/parser.cpp code re-use them too
svn-id: r25564
Diffstat (limited to 'engines/agi/predictive.cpp')
-rw-r--r--engines/agi/predictive.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index e65e1bf2b4..731384b5c7 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -315,19 +315,6 @@ bool AgiEngine::predictiveDialog(void) {
return rc;
}
-static char *ltrim(char *t) {
- while (isspace(*t))
- t++;
- return t;
-}
-
-static char *rtrim(char *t) {
- int l = strlen(t) - 1;
- while (l >= 0 && isspace(t[l]))
- t[l--] = 0;
- return t;
-}
-
#define MAXLINELEN 80
void AgiEngine::loadDict(void) {
@@ -343,7 +330,7 @@ void AgiEngine::loadDict(void) {
while (!in.eos() && in.readLine(buf, MAXLINELEN)) {
// Skip leading & trailing whitespaces
- char *word = rtrim(ltrim(buf));
+ char *word = Common::trim(buf);
// Skip empty lines
if (*word == 0)