aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-02-14 15:07:36 +0000
committerRon Yorston <rmy@pobox.com>2019-02-14 15:07:36 +0000
commitee7e00dc580c4e8075ab0776aeb3526c2c22f2b6 (patch)
treeb934dcdb7b9d27767c5336ad287408242c426b2f /win32
parent6312c005522de47dcaf442f613065415bcbd8ef7 (diff)
downloadbusybox-w32-ee7e00dc580c4e8075ab0776aeb3526c2c22f2b6.tar.gz
busybox-w32-ee7e00dc580c4e8075ab0776aeb3526c2c22f2b6.tar.bz2
busybox-w32-ee7e00dc580c4e8075ab0776aeb3526c2c22f2b6.zip
win32: add a function to remove CRs from a text buffer
Diffstat (limited to 'win32')
-rw-r--r--win32/mingw.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 2a5f96c31..8217ec772 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -1273,6 +1273,17 @@ void FAST_FUNC convert_slashes(char *p)
1273 } 1273 }
1274} 1274}
1275 1275
1276size_t FAST_FUNC remove_cr(char *p, size_t len)
1277{
1278 ssize_t i, j;
1279
1280 for (i=j=0; i<len; ++i) {
1281 if (p[i] != '\r')
1282 p[j++] = p[i];
1283 }
1284 return j;
1285}
1286
1276#undef opendir 1287#undef opendir
1277DIR *mingw_opendir(const char *path) 1288DIR *mingw_opendir(const char *path)
1278{ 1289{