Index: realname.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/realname/Attic/realname.admin.inc,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 realname.admin.inc
--- realname.admin.inc	28 Oct 2010 04:57:27 -0000	1.1.2.11
+++ realname.admin.inc	1 Nov 2010 13:37:19 -0000
@@ -363,7 +363,7 @@
   $form['realname_pattern'] = array(
     '#type' => 'textfield',
     '#field_prefix' => '<strong>'. t('Name Pattern') .'</strong> ',
-    '#description' => t('This determines how the fields will be used to create the "Real name." Use "%1" to refer to the first field, "%2" to refer to the second, etc.'),
+    '#description' => t('This determines how the fields will be used to create the "Real name." Use "%1" to refer to the first field, "%2" to refer to the second, etc. To include a new line separator, enter "\n" (without quotes).'),
     '#size' => 30,
     '#default_value' => variable_get('realname_pattern', '%1'),
   );
Index: realname.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/realname/realname.module,v
retrieving revision 1.4.4.69
diff -u -r1.4.4.69 realname.module
--- realname.module	1 Nov 2010 13:18:04 -0000	1.4.4.69
+++ realname.module	1 Nov 2010 13:33:12 -0000
@@ -824,7 +824,7 @@
       // No, so just return the name.
       return $account->name;
     }
-    $pattern_saved = variable_get('realname_pattern', ' ');
+    $pattern_saved = str_replace('\n', "\n", variable_get('realname_pattern', ' '));
     $homepage = variable_get('realname_homepage', '');
     $use_theme = variable_get('realname_theme', TRUE);
     $module = variable_get('realname_profile_module', NULL);
@@ -838,6 +838,7 @@
       return $account->name;
     }
   }
+
   $pattern = $pattern_saved;
 
   // Has the module been set up yet?
@@ -875,7 +876,9 @@
       }
       else {
         // If there is no value, remove the pattern piece, except the first.
-        $pattern = str_replace('%' . $i, NULL, $pattern);
+        // Do two replaces to make sure new line is done first.
+        $pattern = str_replace("%$i\n", NULL, $pattern);
+        $pattern = str_replace("%$i", NULL, $pattern);
       }
     }
 

