diff src/ops.c @ 994:c5d5e0f3403f v7.0.120

updated for version 7.0-120
author vimboss
date Fri, 06 Oct 2006 21:33:16 +0000
parents b8ed23ef6ff1
children 64e2b75e1615
line wrap: on
line diff
--- a/src/ops.c
+++ b/src/ops.c
@@ -770,6 +770,7 @@ get_expr_line()
 {
     char_u	*expr_copy;
     char_u	*rv;
+    static int	nested = 0;
 
     if (expr_line == NULL)
 	return NULL;
@@ -780,7 +781,14 @@ get_expr_line()
     if (expr_copy == NULL)
 	return NULL;
 
+    /* When we are invoked recursively limit the evaluation to 10 levels.
+     * Then return the string as-is. */
+    if (nested >= 10)
+	return expr_copy;
+
+    ++nested;
     rv = eval_to_string(expr_copy, NULL, TRUE);
+    --nested;
     vim_free(expr_copy);
     return rv;
 }