#!/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
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";