<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div>I’m compiling rsync 3.0.9pre1 using Microsoft Visual Studio 2010 on my windows XP system. I get a compilation failure in flist.c, function send_directory:</div>
<div> </div>
<div>flist.c(1653) : error C2143: syntax error : missing ';' before 'type'</div>
<div>flist.c(1654) : error C2065: 'name_len' : undeclared identifier</div>
<div>flist.c(1654) : warning C4018: '>=' : signed/unsigned mismatch</div>
<div>flist.c(1660) : error C2065: 'name_len' : undeclared identifier</div>
<div> </div>
<div>I realize the construct at this line is valid C99 syntax, which isn’t accepted by MS.</div>
<div> </div>
<div>Can the code be changed to declare this variable at the beginning of the block?</div>
<div> </div>
<div>From:</div>
<div>        for (errno = 0, di = readdir(d); di; errno = 0, di = readdir(d)) {</div>
<div>                char *dname = d_name(di);</div>
<div>                if (dname[0] == '.' && (dname[1] == '\0'</div>
<div>                    || (dname[1] == '.' && dname[2] == '\0')))</div>
<div>                        continue;</div>
<div>                unsigned name_len = strlcpy(p, dname, remainder);</div>
<div> </div>
<div>To:</div>
<div>        for (errno = 0, di = readdir(d); di; errno = 0, di = readdir(d)) {</div>
<div>                char *dname = d_name(di);</div>
<div>                unsigned name_len;</div>
<div>                if (dname[0] == '.' && (dname[1] == '\0'</div>
<div>                    || (dname[1] == '.' && dname[2] == '\0')))</div>
<div>                        continue;</div>
<div>                name_len = strlcpy(p, dname, remainder);</div>
<div> </div>
<div> </div>
</font>
</body>
</html>