#
# Read and parse the configuration files
#
-# Author: Patrick Canterino <patshaping@gmx.net>
-# Last modified: 2004-04-25
+# Author: Patrick Canterino <patrick@patshaping.de>
+# Last modified: 2004-11-24
#
use strict;
#
# Read the configuration files of Dev-Editor
#
-# Params: Path to configuration file
+# Params: Path to main configuration file
#
# Return: Configuration (Hash Reference)
# parse_config()
#
-# Parse an INI-style configuration file
+# Parse a configuration file
#
# Params: Path to configuration file
#
my $file = shift;
local *CF;
- open(CF,"<$file") or croak("Open $file: $!");
+ open(CF,"<".$file) or croak("Open $file: $!");
read(CF, my $data, -s $file);
close(CF);
# Remove whitespaces at the beginning and at the end
- $key =~ s/^\s*//g;
- $key =~ s/\s*$//g;
- $value =~ s/^\s*//g;
- $value =~ s/\s*$//g;
+ $key =~ s/^\s+//g;
+ $key =~ s/\s+$//g;
+ $value =~ s/^\s+//g;
+ $value =~ s/\s+$//g;
croak "Double defined value '$key' in configuration file '$file'" if($config->{$key});