[gnumeric] Allow blanks after the initial operator symbol or = in an expression.



commit 0a8371681910a00d89523d54b5958ba29a5de046
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon Jun 7 07:53:20 2010 -0600

    Allow blanks after the initial operator symbol or = in an expression.
    
    2010-06-07 Andreas J. Guelzow <aguelzow pyrshep ca>
    	for Konstantin Tokarev
    
    	* src/parse-util.c (gnm_expr_char_start_p): allow blanks after
    	the initial operator symbol or = in an expression.

 ChangeLog        |    6 ++++++
 src/parse-util.c |    9 +++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 21d0d67..bb9e0c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
 2010-06-07 Andreas J. Guelzow <aguelzow pyrshep ca>
+	for Konstantin Tokarev
+
+	* src/parse-util.c (gnm_expr_char_start_p): allow blanks after
+	the initial operator symbol or = in an expression.
+
+2010-06-07 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* src/expr-name.h (expr_name_validate): drop Sheet argument
 	* src/commands.c (cmd_define_name): change the caller here
diff --git a/src/parse-util.c b/src/parse-util.c
index fe3c562..c567062 100644
--- a/src/parse-util.c
+++ b/src/parse-util.c
@@ -679,14 +679,19 @@ char const *
 gnm_expr_char_start_p (char const * c)
 {
 	char c0;
+	int N = 1;
 
 	if (NULL == c)
 		return NULL;
 
 	c0 = *c;
 
+	if (c0 == '=' || c0 == '@' || c0 == '+' || c0 == '-')
+		while (c[N] == ' ')
+			N++;
+
 	if (c0 == '=' || c0 == '@' || (c0 == '+' && c[1] == 0))
-		return c + 1;
+		return c + N;
 
 	if ((c0 == '-' || c0 == '+') && c0 != c[1]) {
 		char *end;
@@ -703,7 +708,7 @@ gnm_expr_char_start_p (char const * c)
 		 */
 		(void) gnm_strto (c, &end);
 		if (errno || *end != 0 || end == c)
-			return (c0 == '+') ? c + 1 : c;
+			return (c0 == '+') ? c + N : c;
 		/* Otherwise, it's a number.  */
 	}
 	return NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]