Skip to content
Snippets Groups Projects
Commit 422537ea authored by deuce's avatar deuce
Browse files

Don't add a space to the beginning of a line when unwrapping a soft CR.

parent a39cc1fa
No related branches found
No related tags found
No related merge requests found
......@@ -310,6 +310,7 @@ char* wordwrap(char* inbuf, int len, int oldlen, BOOL handle_quotes)
break;
}
case '\n':
fprintf(stderr, "CR\n");
if(handle_quotes && (quote_count=get_prefix(inbuf+i+1, &prefix_bytes, &prefix_len, len*2+2))!=0) {
/* Move the input pointer offset to the last char of the prefix */
i+=prefix_bytes;
......@@ -375,14 +376,14 @@ char* wordwrap(char* inbuf, int len, int oldlen, BOOL handle_quotes)
continue;
}
else { /* Not a hard CR... add space if needed */
if(l<1 || !isspace((unsigned char)linebuf[l-1])) {
if(ocol > 1 && (l<1 || !isspace((unsigned char)linebuf[l-1]))) {
linebuf[l++]=' ';
ocol++;
}
}
}
else { /* Not a hard CR... add space if needed */
if(l<1 || !isspace((unsigned char)linebuf[l-1])) {
if(ocol > 1 && (l<1 || !isspace((unsigned char)linebuf[l-1]))) {
linebuf[l++]=' ';
ocol++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment