diff -dru teapot-1.07/Makefile teapot-1.07csv/Makefile --- teapot-1.07/Makefile 2003-07-12 09:48:43.000000000 -0700 +++ teapot-1.07csv/Makefile 2005-07-26 14:14:30.000000000 -0700 @@ -1,23 +1,23 @@ #{{{script}}}#{{{ Linux at moria -CFLAGS= -g -pipe -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wcast-qual -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-declarations -Wnested-externs -pedantic -fno-common -CPPFLAGS= -DHAVE_TYPEAHEAD +#CFLAGS= -g -pipe -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wcast-qual -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-declarations -Wnested-externs -pedantic -fno-common +#CPPFLAGS= -DHAVE_TYPEAHEAD #CPPFLAGS= -DHAVE_TYPEAHEAD -DTHE_ELECTRIC_FENCE #CPPFLAGS= -I/usr/dmalloc/include -DDMALLOC -LDFLAGS= -g +#LDFLAGS= -g #LDFLAGS= -g -L/usr/efence/lib #LDFLAGS= -g -L/usr/dmalloc/lib -LIBS= -lcurses -lm +#LIBS= -lcurses -lm #LIBS= -lcurses -lm -lefence #LIBS= -lcurses -lm -ldmalloc -MAKEDEPEND= mkdep -d +#MAKEDEPEND= mkdep -d #}}} #{{{ Linux, SuSE 8.1, ncurses -#CC= gcc -#CFLAGS= -pipe -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wcast-qual -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-declarations -Wnested-externs -pedantic -fno-common -#CPPFLAGS= -I/usr/include/ncurses -DHAVE_TYPEAHEAD -#LDFLAGS= -#LIBS= -lncurses -lm -#MAKEDEPEND= gcc -MM +CC= gcc +CFLAGS= -pipe -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wcast-qual -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-declarations -Wnested-externs -pedantic -fno-common +CPPFLAGS= -I/usr/include/ncurses -DHAVE_TYPEAHEAD +LDFLAGS= +LIBS= -lncurses -lm +MAKEDEPEND= gcc -MM #}}} #{{{ Solaris 9, gcc, ncurses #CC= gcc Only in teapot-1.07csv/: Makefile.orig diff -dru teapot-1.07/csv.c teapot-1.07csv/csv.c --- teapot-1.07/csv.c 2003-07-12 09:48:44.000000000 -0700 +++ teapot-1.07csv/csv.c 2005-07-26 13:55:36.000000000 -0700 @@ -127,15 +127,29 @@ if (*s=='"') { ++s; - while (*s!='\0' && *s!='\n' && *s!='"') + while (*s!='\0' && *s!='\n') { - if ((strings+2)>=stringsz) - { - string=realloc(string,stringsz+=32); - } - string[strings]=*s; - ++strings; - ++s; + if (*s=='"') + { + if (*(s+1)!='"') break; + /* special processing for "", convert it to '' */ + if ((strings+3)>=stringsz) + { + string=realloc(string,stringsz+=32); + } + string[strings]='\''; + string[strings+1]='\''; + strings+=2; + s+=2; + continue; + } + if ((strings+2)>=stringsz) + { + string=realloc(string,stringsz+=32); + } + string[strings]=*s; + ++strings; + ++s; } if (*s=='"') ++s; } diff -dru teapot-1.07/sheet.c teapot-1.07csv/sheet.c --- teapot-1.07/sheet.c 2003-07-12 09:48:43.000000000 -0700 +++ teapot-1.07csv/sheet.c 2005-07-26 12:54:13.000000000 -0700 @@ -1097,7 +1097,7 @@ { for (x=x1; x<=x2; ++x) { - if (x>x1) if (fputc_close('\t',fp)==EOF) return strerror(errno); + if (x>x1) if (fputc_close(',',fp)==EOF) return strerror(errno); if (SHEET(sheet,x,y,z)!=(Cell*)0) { char *buf,*s;