aboutsummaryrefslogtreecommitdiffstats
path: root/nick.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-07-17 11:04:51 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-07-17 11:04:51 +0100
commit177ffd7da1570485698f6c105374e86c4471c94a (patch)
tree428784324a5cdf922a5dcd97ea2ea209ab0c0997 /nick.c
parente43736627ab8fa174352ba6a0122a6dade08a8d7 (diff)
nick_gen() should also insert an underscore if the first character of a nick
would otherwise be a digit.
Diffstat (limited to 'nick.c')
-rw-r--r--nick.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/nick.c b/nick.c
index 0b3fcfbd..d4c1891c 100644
--- a/nick.c
+++ b/nick.c
@@ -184,6 +184,9 @@ char *nick_gen( bee_user_t *bu )
part = asc = g_convert( part, -1, "ASCII//TRANSLIT//IGNORE",
"UTF-8", NULL, NULL, NULL );
+ if( ret->len == 0 && *part && isdigit( *part ) )
+ g_string_append_c( ret, '_' );
+
while( part && *part && *part != chop )
{
if( strchr( nick_lc_chars, *part ) ||