diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_file.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c index 1ef713b105..f3e2879587 100644 --- a/source3/lib/util_file.c +++ b/source3/lib/util_file.c @@ -473,3 +473,26 @@ void file_lines_free(char **lines) free(lines); } + +/**************************************************************************** +take a lislist of lines and modify them to produce a list where \ continues +a line +****************************************************************************/ +void file_lines_slashcont(char **lines) +{ + int i, j; + + for (i=0; lines[i];) { + int len = strlen(lines[i]); + if (lines[i][len-1] == '\\') { + lines[i][len-1] = ' '; + if (lines[i+1]) { + char *p = &lines[i][len]; + while (p < lines[i+1]) *p++ = ' '; + for (j = i+1; lines[j]; j++) lines[j] = lines[j+1]; + } + } else { + i++; + } + } +} |