#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
extern iconv_t ic_chck;
#endif
+extern char curr_dir[];
+extern unsigned int module_dirlen;
static int log_initialised;
static int logfile_was_closed;
{ 0, NULL }
};
-
/*
* Map from rsync error code to name, or return NULL.
*/
for (s = buf; s < end; s++) {
if ((s < end - 4
&& *s == '\\' && s[1] == '#'
- && isdigit(*(uchar*)(s+2))
- && isdigit(*(uchar*)(s+3))
- && isdigit(*(uchar*)(s+4)))
+ && isDigit(s + 2)
+ && isDigit(s + 3)
+ && isDigit(s + 4))
|| (*s != '\t'
- && ((use_isprint && !isprint(*(uchar*)s))
+ && ((use_isprint && !isPrint(s))
|| *(uchar*)s < ' '))) {
if (s != buf && fwrite(buf, s - buf, 1, f) != 1)
exit_cleanup(RERR_MESSAGEIO);
char buf[BIGPATHBUFLEN];
size_t len;
- strcpy(buf, RSYNC_NAME ": ");
+ strlcpy(buf, RSYNC_NAME ": ", sizeof buf);
len = (sizeof RSYNC_NAME ": ") - 1;
va_start(ap, format);
n = fmt + 1;
if (*p == '-')
*n++ = *p++;
- while (isdigit(*(uchar*)p) && n - fmt < (int)(sizeof fmt) - 8)
+ while (isDigit(p) && n - fmt < (int)(sizeof fmt) - 8)
*n++ = *p++;
if (!*p)
break;
strlcpy(n, buf2, MAXPATHLEN);
else
n = buf2;
+ } else if (*n != '/') {
+ pathjoin(buf2, sizeof buf2,
+ curr_dir + module_dirlen, n);
+ clean_fname(buf2, 0);
+ if (fmt[1])
+ strlcpy(n, buf2, MAXPATHLEN);
+ else
+ n = buf2;
} else
clean_fname(n, 0);
if (*n == '/')
case 'L':
if (hlink && *hlink) {
n = hlink;
- strcpy(buf2, " => ");
+ strlcpy(buf2, " => ", sizeof buf2);
} else if (S_ISLNK(file->mode) && file->u.link) {
n = file->u.link;
- strcpy(buf2, " -> ");
+ strlcpy(buf2, " -> ", sizeof buf2);
} else {
n = "";
if (!fmt[1])
break;
- strcpy(buf2, " ");
+ strlcpy(buf2, " ", sizeof buf2);
}
strlcat(fmt, "s", sizeof fmt);
snprintf(buf2 + 4, sizeof buf2 - 4, fmt, n);
int i;
for (i = 2; n[i]; i++)
n[i] = ch;
- } else if (n[0] == '.' || n[0] == 'h'
- || (n[0] == 'c' && n[1] == 'f')) {
+ } else if (n[0] == '.' || n[0] == 'h' || n[0] == 'c') {
int i;
for (i = 2; n[i]; i++) {
if (n[i] != '.')
for (p = format; (p = strchr(p, '%')) != NULL; ) {
if (*++p == '-')
p++;
- while (isdigit(*(uchar*)p))
+ while (isDigit(p))
p++;
if (!*p)
break;