From 789091b928f3de8fd7d0cccb6458b148569d5912 Mon Sep 17 00:00:00 2001 From: stefanjones Date: Wed, 4 Aug 2004 23:16:06 +0000 Subject: [PATCH] Double escape square brackets --- src/tclspice.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tclspice.c b/src/tclspice.c index 96663eada..26cc1b779 100755 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -1339,11 +1339,13 @@ static void escape_brackets(char *string) { if(string[i] == ']' || string[i] == '[') { int j; for(j=printed;j>=i;j--) { - string[j+1] = string[j]; + string[j+3] = string[j]; } string[i] = '\\'; - i++; - printed++; + string[i+1] = '\\'; + string[i+2] = '\\'; + i+=3; + printed+=3; } } return;