Index: pathauto.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/pathauto/pathauto.inc,v
retrieving revision 1.1.2.51
diff -u -p -r1.1.2.51 pathauto.inc
--- pathauto.inc	18 Jun 2008 20:05:08 -0000	1.1.2.51
+++ pathauto.inc	27 May 2009 12:03:05 -0000
@@ -200,6 +200,13 @@ function pathauto_cleanstring($string, $
     // Trim any leading or trailing separators (note the need to
     $output = preg_replace("/^$seppattern+|$seppattern+$/", '', $output);
 
+    // If string contained only punctuation marks which were replaced by separators
+    // when trimming will remove everything from it effectively making it empty string.
+    // Insert single separator into that string.
+    if (empty($output)) {
+      $output = $separator;
+    }
+
     // Replace multiple separators with a single one
     $output = preg_replace("/$seppattern+/", "$separator", $output);
   }
