summaryrefslogtreecommitdiff
path: root/src/dcgen
diff options
context:
space:
mode:
Diffstat (limited to 'src/dcgen')
-rwxr-xr-xsrc/dcgen12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dcgen b/src/dcgen
index a3f04c37c..5df3c56b8 100755
--- a/src/dcgen
+++ b/src/dcgen
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# dcgen -- convert dircolors.hin to dircolors.h.
-# Copyright (C) 1996, 1998, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1998, 2004, 2005, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -44,12 +44,14 @@ while (<>)
and push @line, $_;
}
-my $last_line = pop @line;
my $indent = ' ';
-print "static char const G_line[] =\n";
+print "static char const G_line[] =\n{\n";
foreach (@line)
{
- print "$indent\"$_\\0\"\n";
+ s/./'$&',/g;
+ s/'\\'/'\\\\'/g;
+ s/'''/'\\''/g;
+ print "$indent${_}0,\n";
}
-print "$indent\"$last_line\";\n";
+print "};\n";