git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SPDX: license tags (mostly by guesswork)
[exim.git]
/
src
/
src
/
lookups
/
lf_quote.c
diff --git
a/src/src/lookups/lf_quote.c
b/src/src/lookups/lf_quote.c
index 2a76756e9cf417c2febeec6456424ae2fc12488a..816fe01e2d1083a819f93520fdc69a4b790ce331 100644
(file)
--- a/
src/src/lookups/lf_quote.c
+++ b/
src/src/lookups/lf_quote.c
@@
-2,8
+2,9
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 20
09
*/
+/* Copyright (c) University of Cambridge 1995 - 20
18
*/
/* See the file NOTICE for conditions of use and distribution. */
/* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-only */
#include "../exim.h"
#include "../exim.h"
@@
-22,18
+23,15
@@
Arguments:
name the field name
value the data value
vlength the data length
name the field name
value the data value
vlength the data length
- result the result pointer
- asize points to the size variable
- aoffset points to the offset variable
+ result the result expanding-string
Returns: the result pointer (possibly updated)
*/
Returns: the result pointer (possibly updated)
*/
-uschar *
-lf_quote(uschar *name, uschar *value, int vlength, uschar *result, int *asize,
- int *aoffset)
+gstring *
+lf_quote(uschar *name, uschar *value, int vlength, gstring * result)
{
{
-result = string_append(result,
asize, aoffset,
2, name, US"=");
+result = string_append(result, 2, name, US"=");
/* NULL is handled as an empty string */
/* NULL is handled as an empty string */
@@
-48,20
+46,19
@@
character. */
if (value[0] == 0 || Ustrpbrk(value, " \t\n\r") != NULL || value[0] == '\"')
{
if (value[0] == 0 || Ustrpbrk(value, " \t\n\r") != NULL || value[0] == '\"')
{
- int j;
- result = string_catn(result, asize, aoffset, US"\"", 1);
- for (j = 0; j < vlength; j++)
+ result = string_catn(result, US"\"", 1);
+ for (int j = 0; j < vlength; j++)
{
if (value[j] == '\"' || value[j] == '\\')
{
if (value[j] == '\"' || value[j] == '\\')
- result = string_catn(result,
asize, aoffset,
US"\\", 1);
- result = string_catn(result,
asize, aoffset,
US value+j, 1);
+ result = string_catn(result, US"\\", 1);
+ result = string_catn(result, US value+j, 1);
}
}
- result = string_catn(result,
asize, aoffset,
US"\"", 1);
+ result = string_catn(result, US"\"", 1);
}
else
}
else
- result = string_catn(result,
asize, aoffset,
US value, vlength);
+ result = string_catn(result, US value, vlength);
-return string_catn(result,
asize, aoffset,
US" ", 1);
+return string_catn(result, US" ", 1);
}
/* End of lf_quote.c */
}
/* End of lf_quote.c */