Index: paging.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/paging/paging.module,v
retrieving revision 1.15.2.12
diff -u -p -r1.15.2.12 paging.module
--- paging.module	25 Jan 2008 18:07:19 -0000	1.15.2.12
+++ paging.module	9 Jun 2008 20:34:27 -0000
@@ -64,6 +64,7 @@ function paging_settings() {
     '#size' => 20,
     '#maxlength' => 255,
     '#default_value' => PAGING_SEPARATOR,
+    '#required' => TRUE,
     '#description' => t('Page separator string. You should use an HTML tag that will render reasonably when paging is not enabled, such as <em>&lt;!--pagebreak--&gt;</em> or <em>&lt;HR /&gt;</em>.'),
   );
   $form['paging_config']['paging_read_more_enabled'] = array(
@@ -168,36 +169,36 @@ function _paging_nodeapi(&$node, &$nodeb
       }
       else {
         $custom_body = $nodebody;
-        if (($paging_number = variable_get('paging_automatic_chars', 0)) != 0) {
-          $words_count = strlen($nodebody);
-          $body = $nodebody;
-          if ($words_count > $paging_number) {
-            $breaks = (int)($words_count / $paging_number);
-		    $bodypart = array();
+        if (($chunk_size = variable_get('paging_automatic_chars', 0)) != 0) {
+          $total_chars = strlen($nodebody);
+          if ($total_chars > $chunk_size) {
+            $body = $nodebody;
+            $breaks = (int)($total_chars / $chunk_size);
+            $bodypart = array();
             for ($i = 0; $i <= $breaks; $i++) {
-              $bodypart[$i] = paging_paragraph_split(trim($body), $paging_number);
-              $bodycount = strlen($bodypart[$i]);
-              $body = substr($body, $bodycount);
+              $bodypart[$i] = paging_paragraph_split(trim($body), $chunk_size);
+              $body = substr($body, strlen($bodypart[$i]));
             }
             $custom_body = implode(PAGING_SEPARATOR, $bodypart);
           }
         }
-        elseif (($paging_number = variable_get('paging_automatic_words', 0)) != 0) {
-          $body = explode(' ', $nodebody);
-          $words = count($body);
-          if ($words > $paging_number) {
-            $breaks = (int)($words / $paging_number);
+        elseif (($chunk_size = variable_get('paging_automatic_words', 0)) != 0) {
+          $words = explode(' ', $nodebody);
+          $total_words = count($words);
+          if ($total_words > $chunk_size) {
+            $breaks = (int)($total_words / $chunk_size);
             for ($i = 1; $i < $breaks; $i++) {
-              $index = $i * $paging_number;
-              $body[$index] .= PAGING_SEPARATOR;
+              $index = $i * $chunk_size;
+              $words[$index] .= PAGING_SEPARATOR;
             }
           }
-          $custom_body = implode(' ', $body);
+          $custom_body = implode(' ', $words);
         }
         $node->pages = explode(PAGING_SEPARATOR, $custom_body);
         $node->page_count = count($node->pages);
       }
       break;
+
     case 'view':
       if ($teaser && !$node->in_preview && strpos($nodeteaser, '<!--paging_filter-->') !== FALSE) {
         // Check to see if the teaser is longer than our first page.
@@ -206,6 +207,8 @@ function _paging_nodeapi(&$node, &$nodeb
           $node->pagemore = true;
         }
       }
+      break;
+
     case 'alter':
       if (!$node->in_preview && strpos($teaser ? $nodeteaser : $nodebody, '<!--paging_filter-->') !== FALSE) {
         $element = 1;
