diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-09-30 19:51:39 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-09-30 19:51:39 -0700 |
commit | ed1bf0000e5f2e7538274057f94261fc0eae0e30 (patch) | |
tree | bef812dd38198578d50b54b80522a132434725e4 /src/base/cmd | |
parent | 69519f86cd641dc83da31b79e3b695c7a0165cf6 (diff) | |
download | abc-ed1bf0000e5f2e7538274057f94261fc0eae0e30.tar.gz abc-ed1bf0000e5f2e7538274057f94261fc0eae0e30.tar.bz2 abc-ed1bf0000e5f2e7538274057f94261fc0eae0e30.zip |
Improvements to bit-blaster.
Diffstat (limited to 'src/base/cmd')
-rw-r--r-- | src/base/cmd/cmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/base/cmd/cmd.c b/src/base/cmd/cmd.c index d917cb9d..511cee68 100644 --- a/src/base/cmd/cmd.c +++ b/src/base/cmd/cmd.c @@ -1440,11 +1440,12 @@ int CmdCommandRenameFiles( Abc_Frame_t * pAbc, int argc, char **argv ) // sort by number pOrder = Abc_QuickSortCost( Vec_IntArray(vNums), Vec_IntSize(vNums), 0 ); // rename files in that order - nDigits = Abc_Base10Log( nBase + Vec_IntSize(vNums) ); +// nDigits = Abc_Base10Log( nBase + Vec_IntSize(vNums) ); + nDigits = Abc_Base10Log( nBase + Vec_IntEntry(vNums, pOrder[Vec_IntSize(vNums)-1]) + 1 ); for ( i = 0; i < Vec_IntSize(vNums); i++ ) { pOldName = (char *)Vec_PtrEntry( vNames, pOrder[i] ); - sprintf( pNewName, "%s%0*d.%s", pNameNew ? pNameNew : "", nDigits, nBase+i, pNameExt ); + sprintf( pNewName, "%s%0*d.%s", pNameNew ? pNameNew : "", nDigits, nBase+Vec_IntEntry(vNums, pOrder[i]), pNameExt ); printf( "%s -> %s\n", pOldName, pNewName ); rename( pOldName, pNewName ); } |