+ STATIC CHAR TheMask[MASK_LEN];
+ CHAR *excl, *at;
+
+ assert( Pattern != NULL );
+
+ excl = strchr( Pattern, '!' );
+ at = strchr( Pattern, '@' );
+
+ if(( at ) && ( at < excl )) excl = NULL;
+
+ if(( ! at ) && ( ! excl ))
+ {
+ /* weder ! noch @ĂŠvorhanden: als Nick annehmen */
+ strncpy( TheMask, Pattern, MASK_LEN - 5 );
+ TheMask[MASK_LEN - 5] = '\0';
+ strcat( TheMask, "!*@*" );
+ return TheMask;
+ }
+
+ if(( ! at ) && ( excl ))
+ {
+ /* Domain fehlt */
+ strncpy( TheMask, Pattern, MASK_LEN - 3 );
+ TheMask[MASK_LEN - 3] = '\0';
+ strcat( TheMask, "@*" );
+ return TheMask;
+ }
+
+ if(( at ) && ( ! excl ))
+ {
+ /* User fehlt */
+ *at = '\0'; at++;
+ strncpy( TheMask, Pattern, MASK_LEN - 4 );
+ TheMask[MASK_LEN - 4] = '\0';
+ strcat( TheMask, "!*@" );
+ strncat( TheMask, at, strlen( TheMask ) - MASK_LEN - 1 );
+ TheMask[MASK_LEN - 1] = '\0';
+ return TheMask;
+ }
+
+ /* alle Teile vorhanden */
+ strncpy( TheMask, Pattern, MASK_LEN - 1 );
+ TheMask[MASK_LEN - 1] = '\0';
+ return TheMask;