md5sum: clean up whitespace

Change-Id: I56781a8db29ac53df582dcc2faf6e5713ddcf186
This commit is contained in:
Franklin Wei 2020-07-26 15:41:54 -04:00
parent 2eb7ce475a
commit 796eba4c81

View file

@ -42,11 +42,11 @@ static int hash( char *string, const char *path )
while( !quit && ( len = rb->read( in, buffer, sizeof(buffer) ) ) > 0 ) while( !quit && ( len = rb->read( in, buffer, sizeof(buffer) ) ) > 0 )
{ {
AddMD5( &md5, buffer, len ); AddMD5( &md5, buffer, len );
if( rb->get_action(CONTEXT_STD, TIMEOUT_NOBLOCK) == ACTION_STD_CANCEL ) if( rb->get_action(CONTEXT_STD, TIMEOUT_NOBLOCK) == ACTION_STD_CANCEL )
quit = true; quit = true;
} }
EndMD5( &md5 ); EndMD5( &md5 );
psz_md5_hash( string, &md5 ); psz_md5_hash( string, &md5 );
@ -66,10 +66,10 @@ static void hash_file( int out, const char *path )
done++; done++;
rb->splashf( 0, "%d / %d : %s", done, count, path ); rb->splashf( 0, "%d / %d : %s", done, count, path );
status = hash( string, path ); status = hash( string, path );
if( quit ) if( quit )
return; return;
if( status ) if( status )
rb->write( out, "error", 5 ); rb->write( out, "error", 5 );
else else
@ -77,7 +77,7 @@ static void hash_file( int out, const char *path )
rb->write( out, " ", 2 ); rb->write( out, " ", 2 );
rb->write( out, path, rb->strlen( path ) ); rb->write( out, path, rb->strlen( path ) );
rb->write( out, "\n", 1 ); rb->write( out, "\n", 1 );
rb->yield(); rb->yield();
} }
} }
@ -95,7 +95,7 @@ static void hash_dir( int out, const char *path )
char childpath[MAX_PATH]; char childpath[MAX_PATH];
rb->snprintf( childpath, MAX_PATH, "%s/%s", rb->snprintf( childpath, MAX_PATH, "%s/%s",
rb->strcmp( path, "/" ) ? path : "", entry->d_name ); rb->strcmp( path, "/" ) ? path : "", entry->d_name );
struct dirinfo info = rb->dir_get_info(dir, entry); struct dirinfo info = rb->dir_get_info(dir, entry);
if (info.attribute & ATTR_DIRECTORY) if (info.attribute & ATTR_DIRECTORY)
{ {