projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix crash when parsing a badly formatted variable string.
[pspp]
/
src
/
language
/
expressions
/
parse.c
diff --git
a/src/language/expressions/parse.c
b/src/language/expressions/parse.c
index 24380e28192f3c22274522db12db8f5d401ea32a..906423650753a45d3b3fd9328b82858de57f6ce2 100644
(file)
--- a/
src/language/expressions/parse.c
+++ b/
src/language/expressions/parse.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2010, 2011, 2012
, 2014
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-39,6
+39,7
@@
#include "libpspp/pool.h"
#include "libpspp/str.h"
#include "libpspp/pool.h"
#include "libpspp/str.h"
+#include "gl/c-strcase.h"
#include "gl/xalloc.h"
\f
/* Declarations. */
#include "gl/xalloc.h"
\f
/* Declarations. */
@@
-884,7
+885,7
@@
parse_primary (struct lexer *lexer, struct expression *e)
case T_POS_NUM:
case T_NEG_NUM:
{
case T_POS_NUM:
case T_NEG_NUM:
{
- union any_node *node = expr_allocate_number (e, lex_tokval (lexer)
);
+ union any_node *node = expr_allocate_number (e, lex_tokval (lexer));
lex_get (lexer);
return node;
}
lex_get (lexer);
return node;
}
@@
-1006,7
+1007,7
@@
compare_names (const char *test, const char *name, bool abbrev_ok)
static int
compare_strings (const char *test, const char *name, bool abbrev_ok UNUSED)
{
static int
compare_strings (const char *test, const char *name, bool abbrev_ok UNUSED)
{
- return strcasecmp (test, name);
+ return
c_
strcasecmp (test, name);
}
static bool
}
static bool
@@
-1269,7
+1270,7
@@
parse_function (struct lexer *lexer, struct expression *e)
break;
else if (!lex_match (lexer, T_COMMA))
{
break;
else if (!lex_match (lexer, T_COMMA))
{
- lex_error_expecting (lexer, "`,'", "`)'"
, NULL_SENTINEL
);
+ lex_error_expecting (lexer, "`,'", "`)'");
goto fail;
}
}
goto fail;
}
}
@@
-1291,13
+1292,14
@@
parse_function (struct lexer *lexer, struct expression *e)
msg (SW, _("%s is a PSPP extension."), f->prototype);
if (f->flags & OPF_UNIMPLEMENTED)
{
msg (SW, _("%s is a PSPP extension."), f->prototype);
if (f->flags & OPF_UNIMPLEMENTED)
{
- msg (SE, _("%s is not yet implemented."), f->prototype);
+ msg (SE, _("%s is not available in this version of PSPP."),
+ f->prototype);
goto fail;
}
if ((f->flags & OPF_PERM_ONLY) &&
proc_in_temporary_transformations (e->ds))
{
goto fail;
}
if ((f->flags & OPF_PERM_ONLY) &&
proc_in_temporary_transformations (e->ds))
{
- msg (SE, _("%s may not appear after
TEMPORARY."), f->prototype
);
+ msg (SE, _("%s may not appear after
%s."), f->prototype, "TEMPORARY"
);
goto fail;
}
goto fail;
}