diff options
Diffstat (limited to 'src/dcgen')
-rwxr-xr-x | src/dcgen | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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"; |