"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "params.c" between
rsync-3.2.1.tar.gz and rsync-3.2.2.tar.gz

About: rsync is a fast incremental file-copying tool for bringing remote (and local) files into sync.

params.c  (rsync-3.2.1):params.c  (rsync-3.2.2)
skipping to change at line 213 skipping to change at line 213
/* past initial white space. */ /* past initial white space. */
while( (EOF != c) && (c > 0) ) while( (EOF != c) && (c > 0) )
{ {
/* Check that the buffer is big enough for the next character. */ /* Check that the buffer is big enough for the next character. */
if( i > (bSize - 2) ) if( i > (bSize - 2) )
{ {
bSize += BUFR_INC; bSize += BUFR_INC;
bufr = realloc_array( bufr, char, bSize ); bufr = realloc_array( bufr, char, bSize );
if( NULL == bufr )
{
rprintf(FLOG, "%s Memory re-allocation failure.", func);
return( False );
}
} }
/* Handle a single character. */ /* Handle a single character. */
switch( c ) switch( c )
{ {
case ']': /* Found the closing bracket. */ case ']': /* Found the closing bracket. */
bufr[end] = '\0'; bufr[end] = '\0';
if( 0 == end ) /* Don't allow an empty name. */ if( 0 == end ) /* Don't allow an empty name. */
{ {
rprintf(FLOG, "%s Empty section name in config file.\n", func ); rprintf(FLOG, "%s Empty section name in config file.\n", func );
skipping to change at line 307 skipping to change at line 302
char *func = "params.c:Parameter() -"; char *func = "params.c:Parameter() -";
/* Read the parameter name. */ /* Read the parameter name. */
while( 0 == vstart ) /* Loop until we've found the start of the value. */ while( 0 == vstart ) /* Loop until we've found the start of the value. */
{ {
if( i > (bSize - 2) ) /* Ensure there's space for next char. */ if( i > (bSize - 2) ) /* Ensure there's space for next char. */
{ {
bSize += BUFR_INC; bSize += BUFR_INC;
bufr = realloc_array( bufr, char, bSize ); bufr = realloc_array( bufr, char, bSize );
if( NULL == bufr )
{
rprintf(FLOG, "%s Memory re-allocation failure.", func) ;
return( False );
}
} }
switch( c ) switch( c )
{ {
case '=': /* Equal sign marks end of param name. */ case '=': /* Equal sign marks end of param name. */
if( 0 == end ) /* Don't allow an empty name. */ if( 0 == end ) /* Don't allow an empty name. */
{ {
rprintf(FLOG, "%s Invalid parameter name in config file.\n", func ); rprintf(FLOG, "%s Invalid parameter name in config file.\n", func );
return( False ); return( False );
} }
skipping to change at line 383 skipping to change at line 373
} }
/* Now parse the value. */ /* Now parse the value. */
while( (EOF !=c) && (c > 0) ) while( (EOF !=c) && (c > 0) )
{ {
if( i > (bSize - 2) ) /* Make sure there's enough room. */ if( i > (bSize - 2) ) /* Make sure there's enough room. */
{ {
bSize += BUFR_INC; bSize += BUFR_INC;
bufr = realloc_array( bufr, char, bSize ); bufr = realloc_array( bufr, char, bSize );
if( NULL == bufr )
{
rprintf(FLOG, "%s Memory re-allocation failure.", func) ;
return( False );
}
} }
switch( c ) switch( c )
{ {
case '\r': /* Explicitly remove '\r' because the older */ case '\r': /* Explicitly remove '\r' because the older */
c = getc( InFile ); /* version called fgets_slash() which also */ c = getc( InFile ); /* version called fgets_slash() which also */
break; /* removes them. */ break; /* removes them. */
case '\n': /* Marks end of value unless there's a '\'. */ case '\n': /* Marks end of value unless there's a '\'. */
i = Continuation( bufr, i ); i = Continuation( bufr, i );
skipping to change at line 640 skipping to change at line 625
return( False ); return( False );
if( NULL != bufr ) /* If we already have a buffer */ if( NULL != bufr ) /* If we already have a buffer */
result = Parse( InFile, sfunc, pfunc ); /* (recursive call), then just */ result = Parse( InFile, sfunc, pfunc ); /* (recursive call), then just */
/* use it. */ /* use it. */
else /* If we don't have a buffer */ else /* If we don't have a buffer */
{ /* allocate one, then parse, */ { /* allocate one, then parse, */
bSize = BUFR_INC; /* then free. */ bSize = BUFR_INC; /* then free. */
bufr = new_array( char, bSize ); bufr = new_array( char, bSize );
if( NULL == bufr )
{
rprintf(FLOG, "%s memory allocation failure.\n", func);
fclose(InFile);
return( False );
}
result = Parse( InFile, sfunc, pfunc ); result = Parse( InFile, sfunc, pfunc );
free( bufr ); free( bufr );
bufr = NULL; bufr = NULL;
bSize = 0; bSize = 0;
} }
fclose(InFile); fclose(InFile);
if( !result ) /* Generic failure. */ if( !result ) /* Generic failure. */
{ {
 End of changes. 4 change blocks. 
21 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)