On 16/03/25 16:18, Peter via Postfix-users wrote:
This is a relatively simple patch, for the sake of simplicity it replaces the linefeed at read time, but a slightly more complicated patch that does it when lines are output to dst might be more appropriate.  Note this is untested:

...and I realized that the string has to be terminated:

--- postfix-3.10.1/src/postconf/postconf_edit.c.orig 2025-03-15 16:40:20.187982007 +1300 +++ postfix-3.10.1/src/postconf/postconf_edit.c 2025-03-16 16:26:15.607136436 +1300
@@ -114,7 +114,9 @@
 {
     char   *cp;

-    while (vstring_get(buf, src) != VSTREAM_EOF) {
+    while (vstring_get_nonl(buf, src) != VSTREAM_EOF) {
+       VSTRING_ADDCH(buf, '\n');
+       VSTRING_TERMINATE(buf);
        if (lineno)
            *lineno += 1;
        if ((cp = pcf_find_cf_info(buf, dst)) != 0)


Peter

_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to