* fix: don't rename target/names without numeric suffix on paste to non clashing namespace

This commit is contained in:
Garux
2021-11-24 18:00:37 +03:00
parent e62483970f
commit 1f7d0250b0
3 changed files with 21 additions and 22 deletions

View File

@@ -29,15 +29,16 @@
#if 1
class Postfix
{
unsigned int m_value;
int m_value; // -1 is special value to handle empty postfix
public:
Postfix( const char* postfix ) : m_value( atoi( postfix ) ){
Postfix( const char* postfix ) : m_value( string_empty( postfix )? -1 : atoi( postfix ) ){
}
unsigned int number() const {
int number() const {
return m_value;
}
void write( char* buffer ) const {
sprintf( buffer, "%u", m_value );
if( m_value != -1 )
sprintf( buffer, "%i", m_value );
}
Postfix& operator++(){
++m_value;