Deleted Added
full compact
cvt.c (238730) cvt.c (293190)
1/*
1/*
2 * Copyright (C) 1984-2012 Mark Nudelman
2 * Copyright (C) 1984-2015 Mark Nudelman
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Less License, as specified in the README file.
6 *
7 * For more information, see the README file.
8 */
9
10/*

--- 59 unchanged lines hidden (view full) ---

70
71 if (lenp != NULL)
72 src_end = osrc + *lenp;
73 else
74 src_end = osrc + strlen(osrc);
75
76 for (src = osrc, dst = odst; src < src_end; )
77 {
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Less License, as specified in the README file.
6 *
7 * For more information, see the README file.
8 */
9
10/*

--- 59 unchanged lines hidden (view full) ---

70
71 if (lenp != NULL)
72 src_end = osrc + *lenp;
73 else
74 src_end = osrc + strlen(osrc);
75
76 for (src = osrc, dst = odst; src < src_end; )
77 {
78 int src_pos = src - osrc;
79 int dst_pos = dst - odst;
78 int src_pos = (int) (src - osrc);
79 int dst_pos = (int) (dst - odst);
80 ch = step_char(&src, +1, src_end);
81 if ((ops & CVT_BS) && ch == '\b' && dst > odst)
82 {
83 /* Delete backspace and preceding char. */
84 do {
85 dst--;
86 } while (dst > odst &&
87 !IS_ASCII_OCTET(*dst) && !IS_UTF8_LEAD(*dst));

--- 16 unchanged lines hidden (view full) ---

104 }
105 if (dst > edst)
106 edst = dst;
107 }
108 if ((ops & CVT_CRLF) && edst > odst && edst[-1] == '\r')
109 edst--;
110 *edst = '\0';
111 if (lenp != NULL)
80 ch = step_char(&src, +1, src_end);
81 if ((ops & CVT_BS) && ch == '\b' && dst > odst)
82 {
83 /* Delete backspace and preceding char. */
84 do {
85 dst--;
86 } while (dst > odst &&
87 !IS_ASCII_OCTET(*dst) && !IS_UTF8_LEAD(*dst));

--- 16 unchanged lines hidden (view full) ---

104 }
105 if (dst > edst)
106 edst = dst;
107 }
108 if ((ops & CVT_CRLF) && edst > odst && edst[-1] == '\r')
109 edst--;
110 *edst = '\0';
111 if (lenp != NULL)
112 *lenp = edst - odst;
112 *lenp = (int) (edst - odst);
113 /* FIXME: why was this here? if (chpos != NULL) chpos[dst - odst] = src - osrc; */
114}
113 /* FIXME: why was this here? if (chpos != NULL) chpos[dst - odst] = src - osrc; */
114}