Set number_separator the first time it gets used.

This commit is contained in:
Wayne Davison committed 2013-06-11 13:28:45 -07:00
1 parent a508e88fcf
commit fc2d6fabe7
6 files changed
+10 -21

No files matched your search

+10 -1
View File
@@ -22,7 +22,7 @@
#include "rsync.h"
#include "itypes.h"
extern char number_separator;
static char number_separator;
#ifndef HAVE_STRDUP
char *strdup(char *s)
@@ -190,6 +190,15 @@ char *do_big_num(int64 num, int human_flag, const char *fract)
char *s;
int len, negated;
if (human_flag && !number_separator) {
char buf[32];
snprintf(buf, sizeof buf, "%f", 3.14);
if (strchr(buf, '.') != NULL)
number_separator = ',';
else
number_separator = '.';
}
n = (n + 1) % (sizeof bufs / sizeof bufs[0]);
if (human_flag > 1) {
-10
View File
@@ -123,7 +123,6 @@ int checksum_seed = 0;
int inplace = 0;
int delay_updates = 0;
long block_size = 0; /* "long" because popt can't set an int32. */
char number_separator;
char *skip_compress = NULL;
item_list dparam_list = EMPTY_ITEM_LIST;
@@ -1870,15 +1869,6 @@ int parse_arguments(int *argc_p, const char ***argv_p)
verbose > 1 ? "stats3" : "stats2", DEFAULT_PRIORITY);
}
if (human_readable) {
char buf[32];
snprintf(buf, sizeof buf, "%f", 3.14);
if (strchr(buf, '.') != NULL)
number_separator = ',';
else
number_separator = '.';
}
#ifdef ICONV_OPTION
if (iconv_opt && protect_args != 2) {
if (!am_server && strcmp(iconv_opt, "-") == 0)
-1
View File
@@ -30,7 +30,6 @@ int module_dirlen = 0;
int preserve_acls = 0;
int preserve_times = 0;
int preserve_xattrs = 0;
char number_separator = ',';
char *partial_dir;
char *module_dir;
filter_rule_list daemon_filter_list;
-7
View File
@@ -51,7 +51,6 @@ int link_owner = 0;
int nsec_times = 0;
int preserve_perms = 0;
int preserve_executability = 0;
char number_separator;
#ifdef SUPPORT_XATTRS
@@ -255,12 +254,6 @@ main(int argc, char *argv[])
if (!extra_args || *extra_args == NULL)
tls_usage(1);
snprintf(buf, sizeof buf, "%f", 3.14);
if (strchr(buf, '.') != NULL)
number_separator = ',';
else
number_separator = '.';
for (; *extra_args; extra_args++)
list_file(*extra_args);
poptFreeContext(pc);
-1
View File
@@ -28,7 +28,6 @@ int read_only = 1;
int list_only = 0;
int preserve_perms = 0;
int preserve_executability = 0;
char number_separator = ',';
int
main(int argc, char **argv)
-1
View File
@@ -31,7 +31,6 @@ int fnmatch_errors = 0;
#endif
int wildmatch_errors = 0;
char number_separator = ',';
typedef char bool;