[gimp] pdbgen: fix trailing whitespaces in generated C doc in empty lines.



commit 008a40b877a516e3f530b4583c6f8583067df578
Author: Jehan <jehan girinstud io>
Date:   Sat Oct 5 19:48:39 2013 +1300

    pdbgen: fix trailing whitespaces in generated C doc in empty lines.

 libgimp/gimpimage_pdb.c |    2 +-
 libgimp/gimplayer_pdb.c |    4 ++--
 tools/pdbgen/lib.pl     |    6 +++++-
 3 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/libgimp/gimpimage_pdb.c b/libgimp/gimpimage_pdb.c
index fc8fc04..ace2f69 100644
--- a/libgimp/gimpimage_pdb.c
+++ b/libgimp/gimpimage_pdb.c
@@ -122,7 +122,7 @@ gimp_image_list (gint *num_images)
  * as an argument will fail. Layers can be created using the
  * gimp_layer_new() commands. They can be added to an image using the
  * gimp_image_insert_layer() command.
- * 
+ *
  * If your image's type if INDEXED, a colormap must also be added with
  * gimp_image_set_colormap(). An indexed image without a colormap will
  * output unexpected colors.
diff --git a/libgimp/gimplayer_pdb.c b/libgimp/gimplayer_pdb.c
index 8bcfd47..fbc9e29 100644
--- a/libgimp/gimplayer_pdb.c
+++ b/libgimp/gimplayer_pdb.c
@@ -559,10 +559,10 @@ gimp_layer_set_offsets (gint32 layer_ID,
  * - the current selection;
  * - a grayscale copy of the layer;
  * - or a copy of the active channel.
- * 
+ *
  * The layer mask still needs to be added to the layer. This can be
  * done with a call to gimp_layer_add_mask().
- * 
+ *
  * gimp_layer_create_mask() will fail if there are no active channels
  * on the image, when called with 'ADD-CHANNEL-MASK'. It will return a
  * black mask when called with 'ADD-ALPHA-MASK' or
diff --git a/tools/pdbgen/lib.pl b/tools/pdbgen/lib.pl
index d4c991a..1f6c296 100644
--- a/tools/pdbgen/lib.pl
+++ b/tools/pdbgen/lib.pl
@@ -33,11 +33,15 @@ use Text::Wrap qw(wrap);
 sub desc_wrap {
     my ($str) = @_;
     my $leading = ' * ';
+    my $wrapped;
+
     $str =~ s/&/&amp\;/g;
     $str =~ s/\</&lt\;/g;
     $str =~ s/\>/&gt\;/g;
     $Text::Wrap::columns = 72;
-    wrap($leading, $leading, $str);
+    $wrapped = wrap($leading, $leading, $str);
+    $wrapped =~ s/[ \t]+\n/\n/g;
+    return $wrapped;
 }
 
 sub generate {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]