Index: tools/client-side/svnmucc/svnmucc.c =================================================================== --- tools/client-side/svnmucc/svnmucc.c (revision 38429) +++ tools/client-side/svnmucc/svnmucc.c (working copy) @@ -71,6 +71,56 @@ return pool; } +void +read_extra_args(apr_array_header_t *array, + const char *input, + char continuation_char, + apr_pool_t *pool) +{ + const char *sep_chars="\r\n"; + char *last; + char *pats; + char *p; + char *holder; + int plen; + + pats = apr_pstrdup(pool, input); /* strtok wants non-const data */ + p = apr_strtok(pats, sep_chars, &last); + holder = NULL; + + while (p) + { + plen = strlen(p); + if( plen > 0 && p[plen-1] == continuation_char && continuation_char != '\0' ) + { + p[plen-1] = '\0'; + if( holder == NULL ) + holder = apr_pstrdup( pool, p ); + else + holder = apr_pstrcat( pool, holder, "\n", p, NULL ); + } + else + { + if( holder != NULL ) + { + holder = apr_pstrcat( pool, holder, "\n", p, NULL ); + } + else + { + holder = p; + } + + if (holder[0] != '\0') + APR_ARRAY_PUSH(array, const char *) = holder; + holder = NULL; + } + + p = apr_strtok(NULL, sep_chars, &last); + } + + return; +} + static svn_error_t * open_tmp_file(apr_file_t **fp, void *callback_baton, @@ -704,6 +754,10 @@ " -n, --non-interactive don't prompt the user about anything\n" " -X, --extra-args ARG append arguments from file ARG (one per line;\n" " use \"-\" to read from standard input)\n" + " -c, --continuation-char ARG\n" + " use ARG as a continuation character when using\n" + " -X. Placing ARG at the end of line will mean\n" + " the next line is counted as the same line\n" " --config-dir ARG use ARG to override the config directory\n"; svn_error_clear(svn_cmdline_fputs(msg, stream, pool)); apr_pool_destroy(pool); @@ -742,13 +796,15 @@ {"extra-args", 'X', 1, ""}, {"help", 'h', 0, ""}, {"non-interactive", 'n', 0, ""}, - {"config-dir", config_dir_opt, 1, ""}, + {"continuation-char", 'c', 1, "" }, + {"config-dir", config_dir_opt, 1, ""}, {NULL, 0, 0, NULL} }; const char *message = NULL; const char *username = NULL, *password = NULL; const char *root_url = NULL, *extra_args_file = NULL; const char *config_dir = NULL; + char continuation_char = '\0'; svn_boolean_t non_interactive = FALSE; svn_revnum_t base_revision = SVN_INVALID_REVNUM; apr_array_header_t *action_args; @@ -825,6 +881,9 @@ case 'n': non_interactive = TRUE; break; + case 'c': + continuation_char = arg[0]; + break; case config_dir_opt: err = svn_utf_cstring_to_utf8(&config_dir, arg, pool); if (err) @@ -862,8 +921,7 @@ err = svn_utf_stringbuf_to_utf8(&contents_utf8, contents, pool); if (err) handle_error(err, pool); - svn_cstring_split_append(action_args, contents_utf8->data, "\n\r", - FALSE, pool); + read_extra_args(action_args, contents_utf8->data, continuation_char, pool); } /* Now, we iterate over the combined set of arguments -- our actions. */