[Libpst-devel] More readpst.c fixes

Nigel Horne njh at bandsman.co.uk
Tue May 2 10:30:12 UTC 2006


More fixes to rfc2426_escape(char *str), this time to fix the handling
of \r which left a byte of junk in the output, and the handling of \n which
wasn't correct according to RFC 2426.

-Nigel

*** Oreadpst.c	Tue May  2 11:27:02 2006
--- readpst.c	Tue May  2 11:28:02 2006
***************
*** 1419,1432 ****
        b = buf;
        while (*a != '\0') {
  	switch(*a) {
  	case ',' :
  	case '\\':
  	case ';' :
- 	case '\n':
  	  *b++ = '\\';
  	  *b=*a;
  	break;
  	case '\r':
  	  break;
  	default:
  	  *b=*a;
--- 1419,1436 ----
        b = buf;
        while (*a != '\0') {
  	switch(*a) {
+ 	case '\n':
+ 	  *b++ = '\\';
+ 	  *b = 'n';
+ 	  break;
  	case ',' :
  	case '\\':
  	case ';' :
  	  *b++ = '\\';
  	  *b=*a;
  	break;
  	case '\r':
+ 		--b;
  	  break;
  	default:
  	  *b=*a;



More information about the Libpst-devel mailing list