]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix thinko with the first line of a program.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Apr 2002 10:21:50 +0000 (10:21 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 15 Apr 2002 10:21:50 +0000 (10:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@5654 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/tutorial/chapter-2.step-by-step/program2html
deal.II/doc/tutorial/chapter-2.step-by-step/program2plain

index 7d80541ba49dc7deeaae09e318b1ff1781419649..75c80af247983fe01bd5e26371f050ced72067d2 100644 (file)
@@ -18,7 +18,7 @@ $state =  $comment_mode;
 
 print "<p>\n";
 
-while (<>) {
+do {
     # substitute special characters
     s/&/&amp;/g;
     s/</&lt;/g;
@@ -67,7 +67,7 @@ while (<>) {
     {
        print "        $_";
     }
-}
+} while (<>);
 
 if ($state == $program_mode) {
    print "</code></pre>\n";
index 18e34b3d2ff064a6119856cd4a9ef8e831267271..2187b4d9533c022bd5ade519f4cf3d29672ff4ae 100644 (file)
@@ -20,17 +20,17 @@ print <<END;
 END
 
 
-while (<>) {
+do {
     # ignore comment lines
-    next if m!^\s*//!;  
-
-    # substitute special characters
-    s/&/&amp;/g;
-    s/</&lt;/g;
-    s/>/&gt;/g;
-    s/\t/        /g;
-
-    print "  $_";
-}
+    if ( ! m!^\s*//! ) {
+       # substitute special characters
+       s/&/&amp;/g; 
+       s/</&lt;/g;      
+       s/>/&gt;/g;
+       s/\t/        /g;
+
+       print "  $_";
+    }
+} while (<>);
 
 print "</code></pre>\n</p>\n\n";

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.