MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / lf_to_crlf

Function lf_to_crlf

cppcryptfs/ui/CryptAboutPropertyPage.cpp:113–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111END_MESSAGE_MAP()
112
113static CString lf_to_crlf(const wchar_t* txt)
114{
115 CString fixed;
116
117 auto len = wcslen(txt);
118
119 if (len < 1)
120 return fixed;
121
122 fixed += txt[0];
123
124 for (size_t i = 1; i < len; i++) {
125 if (txt[i] == '\n' && txt[i - 1] != '\r') {
126 fixed += '\r';
127 fixed += '\n';
128 } else {
129 fixed += txt[i];
130 }
131 }
132 return fixed;
133}
134
135// CCryptAboutPropertyPage message handlers
136

Callers 2

OnInitDialogMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected