X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/cc3e685d09b2095099fc396157d19172ab3ef7c4..5214a41bbae94607b196b199b483710e1babf292:/transliterate.diff diff --git a/transliterate.diff b/transliterate.diff index 993b641..77f9ed8 100644 --- a/transliterate.diff +++ b/transliterate.diff @@ -13,20 +13,21 @@ To use this patch, run these commands for a successful build: ./configure (optional if already run) make +based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d diff --git a/flist.c b/flist.c --- a/flist.c +++ b/flist.c -@@ -81,6 +81,9 @@ extern int filesfrom_convert; +@@ -86,6 +86,9 @@ extern int filesfrom_convert; extern iconv_t ic_send, ic_recv; #endif +extern char *tr_opt, *tr_left, *tr_right; +extern int tr_right_len; + - #define PTR_SIZE (sizeof (struct file_struct *)) - - int io_error; -@@ -606,6 +609,24 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ + #ifdef HAVE_UTIMENSAT + #ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + #define ST_MTIME_NSEC st_mtim.tv_nsec +@@ -673,6 +676,24 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file, stats.total_size += F_LENGTH(file); } @@ -48,23 +49,23 @@ diff --git a/flist.c b/flist.c + *p2 = '\0'; +} + - static struct file_struct *recv_file_entry(struct file_list *flist, - int xflags, int f) + static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags) { -@@ -674,6 +695,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist, + static int64 modtime; +@@ -741,6 +762,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x } #endif + if (tr_opt) + transliterate(thisname); + - clean_fname(thisname, 0); + if (*thisname) + clean_fname(thisname, 0); - if (sanitize_paths) diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -182,6 +182,8 @@ int logfile_format_has_i = 0; +@@ -190,6 +190,8 @@ int logfile_format_has_i = 0; int logfile_format_has_o_or_i = 0; int always_checksum = 0; int list_only = 0; @@ -73,7 +74,7 @@ diff --git a/options.c b/options.c #define MAX_BATCH_NAME_LEN 256 /* Must be less than MAXPATHLEN-13 */ char *batch_name = NULL; -@@ -425,6 +427,7 @@ void usage(enum logcode F) +@@ -783,6 +785,7 @@ void usage(enum logcode F) #ifdef ICONV_OPTION rprintf(F," --iconv=CONVERT_SPEC request charset conversion of filenames\n"); #endif @@ -81,15 +82,15 @@ diff --git a/options.c b/options.c rprintf(F," -4, --ipv4 prefer IPv4\n"); rprintf(F," -6, --ipv6 prefer IPv6\n"); rprintf(F," --version print version number\n"); -@@ -612,6 +615,7 @@ static struct poptOption long_options[] = { - #ifdef ICONV_OPTION +@@ -996,6 +999,7 @@ static struct poptOption long_options[] = { {"iconv", 0, POPT_ARG_STRING, &iconv_opt, 0, 0, 0 }, + {"no-iconv", 0, POPT_ARG_NONE, 0, OPT_NO_ICONV, 0, 0 }, #endif + {"tr", 0, POPT_ARG_STRING, &tr_opt, 0, 0, 0 }, {"ipv4", '4', POPT_ARG_VAL, &default_af_hint, AF_INET, 0, 0 }, {"ipv6", '6', POPT_ARG_VAL, &default_af_hint, AF_INET6, 0, 0 }, - {"8-bit-output", '8', POPT_ARG_NONE, &allow_8bit_chars, 0, 0, 0 }, -@@ -1623,6 +1627,31 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) + {"8-bit-output", '8', POPT_ARG_VAL, &allow_8bit_chars, 1, 0, 0 }, +@@ -2232,6 +2236,31 @@ int parse_arguments(int *argc_p, const char ***argv_p) } } @@ -121,7 +122,7 @@ diff --git a/options.c b/options.c am_starting_up = 0; return 1; -@@ -1991,6 +2020,12 @@ void server_options(char **args, int *argc_p) +@@ -2646,6 +2675,12 @@ void server_options(char **args, int *argc_p) else if (remove_source_files) args[ac++] = "--remove-sent-files"; @@ -131,13 +132,13 @@ diff --git a/options.c b/options.c + args[ac++] = arg; + } + - *argc_p = ac; - return; - + if (ac > MAX_SERVER_ARGS) { /* Not possible... */ + rprintf(FERROR, "argc overflow in server_options().\n"); + exit_cleanup(RERR_MALLOC); diff --git a/rsync.yo b/rsync.yo --- a/rsync.yo +++ b/rsync.yo -@@ -423,6 +423,7 @@ to the detailed description below for a complete description. verb( +@@ -436,6 +436,7 @@ to the detailed description below for a complete description. verb( --read-batch=FILE read a batched update from FILE --protocol=NUM force an older protocol version to be used --iconv=CONVERT_SPEC request charset conversion of filenames @@ -145,9 +146,9 @@ diff --git a/rsync.yo b/rsync.yo --checksum-seed=NUM set block/file checksum seed (advanced) -4, --ipv4 prefer IPv4 -6, --ipv6 prefer IPv6 -@@ -2030,6 +2031,22 @@ specifying matching rules that can match on both sides of the transfer. - For instance, you can specify extra include/exclude rules if there are - filename differences on the two sides that need to be accounted for. +@@ -2359,6 +2360,22 @@ daemon uses the charset specified in its "charset" configuration parameter + regardless of the remote charset you actually pass. Thus, you may feel free to + specify just the local charset for a daemon transfer (e.g. bf(--iconv=utf8)). +dit(bf(--tr=BAD/GOOD)) Transliterates filenames on the receiver, after the +iconv conversion (if any). This can be used to remove characters illegal