annotate archive/readpst.c.diff @ 385:0917d53d78b3

Rename configure.in to configure.ac The old name was deprecated in 2013. See-also: https://lists.gnu.org/archive/html/automake/2013-05/msg00049.html Suggested-by: lintian, aclocal X: libpst source: deprecated-configure-filename aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
author Paul Wise <pabs3@bonedaddy.net>
date Sat, 21 Dec 2019 21:25:44 +0800
parents de3753c3160a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
57
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
1 Index: readpst.c
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
2 ===================================================================
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
3 --- readpst.c (revision 45)
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
4 +++ readpst.c (working copy)
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
5 @@ -1396,6 +1396,7 @@
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
6 // char *rfc2426_escape(char *str) {{{1
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
7 char *rfc2426_escape(char *str) {
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
8 static char *buf = NULL;
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
9 + static int buflen = 0;
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
10 char *a, *b;
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
11 int x, y, z;
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
12 DEBUG_ENT("rfc2426_escape");
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
13 @@ -1411,9 +1412,10 @@
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
14 z = chr_count(str, '\r');
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
15 x = strlen(str) + y - z;
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
16
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
17 - if ( (y - z) == 0 ) // resize buffer if needed
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
18 + if ( x + 1 > buflen ) // resize buffer if needed
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
19 {
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
20 buf = (char*) realloc(buf, x + 1); // don't forget room for the NUL
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
21 + buflen = x + 1;
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
22 if ( buf == NULL )
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
23 {
de3753c3160a add archive directory with history of alioth versions that have been merged here
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
24 fprintf(stderr, "Error: rfc2426_escape(): realloc(%d) returned NULL!\n", x + 1);