diff options
author | carlosg <carlosg> | 2004-12-06 10:58:53 +0000 |
---|---|---|
committer | carlosg <carlosg> | 2004-12-06 10:58:53 +0000 |
commit | 2b3b77b03813eafc08e5c5e16bf86e209e223b37 (patch) | |
tree | b2b9a25b08c19dfbe9ef9dbcc5380cb6f6dcc4d5 | |
parent | e91fb36e057a3f6cc01357183304714dd169e79d (diff) |
2004-12-06 Carlos Garnacho Parro <carlosg@gnome.org>
* network.pl.in, parse.pl.in: improved debian essid and wep key parsing
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | network.pl.in | 27 | ||||
-rw-r--r-- | parse.pl.in | 20 |
3 files changed, 12 insertions, 39 deletions
@@ -1,3 +1,7 @@ +2004-12-06 Carlos Garnacho Parro <carlosg@gnome.org> + + * network.pl.in, parse.pl.in: improved debian essid and wep key parsing + 2004-11-14 Carlos Garnacho Parro <carlosg@gnome.org> * Makefile.am: moved the intltool-* files to DISTCLEANFILES. diff --git a/network.pl.in b/network.pl.in index 09b1f12..b9c60ff 100644 --- a/network.pl.in +++ b/network.pl.in @@ -42,29 +42,6 @@ require "$SCRIPTSDIR/service.pl$DOTIN"; require "$SCRIPTSDIR/util.pl$DOTIN"; require "$SCRIPTSDIR/xml.pl$DOTIN"; - -# Shared XML printing function -sub network_xml_print_statichost -{ - my ($h) = $_[0]; - my ($statichost, $i, $j, $val); - - &gst_xml_print_vspace (); - foreach $i (keys %{$$h{"statichost"}}) - { - $statichost = $ {$$h{"statichost"}}{$i}; - &gst_xml_container_enter ("statichost"); - $val = &gst_xml_quote ($i); - &gst_xml_print_pcdata ("ip", $val); - foreach $j (@$statichost) - { - $val = &gst_xml_quote ($j); - &gst_xml_print_pcdata ("alias", $val); - } - &gst_xml_container_leave ("statichost"); - } -} - sub gst_network_get_linux_wireless_ifaces { my ($fd, $line); @@ -4389,8 +4366,8 @@ sub gst_network_get_interface_parse_table [ "broadcast", \&gst_parse_interfaces_option_str, [INTERFACES, IFACE], "broadcast" ], [ "network", \&gst_parse_interfaces_option_str, [INTERFACES, IFACE], "network" ], [ "gateway", \&gst_parse_interfaces_option_str, [INTERFACES, IFACE], "gateway" ], - [ "essid", \&gst_parse_interfaces_option_str, [INTERFACES, IFACE], "wireless_essid" ], - [ "key", \&gst_parse_interfaces_option_str, [INTERFACES, IFACE], "wireless_key" ], + [ "essid", \&gst_parse_interfaces_option_str, [INTERFACES, IFACE], "wireless[_-]essid" ], + [ "key", \&gst_parse_interfaces_option_str, [INTERFACES, IFACE], "wireless[_-]key1?" ], [ "wvsection", \&gst_parse_interfaces_option_str, [INTERFACES, IFACE], "provider" ], [ "update_dns", \&gst_network_pump_get_nodns, PUMP, "%dev%", "%bootproto%" ], [ "update_dns", \&gst_parse_kw, PPP_OPTIONS, "usepeerdns" ], diff --git a/parse.pl.in b/parse.pl.in index a41ce3a..450b924 100644 --- a/parse.pl.in +++ b/parse.pl.in @@ -820,25 +820,17 @@ sub gst_parse_ini { $_ = $$line; next if (/^$/); - if (/\[$section\]/i) { + s/\[$section\][ \t]*//i; $found_section_flag = 1; - next; } - if ($found_section_flag) + if ($found_section_flag && /^$var[ \t]*=/i) { - if (/^$var[ \t]*=/i) - { - s/^$var[ \t]*=[ \t]*//i; - $res = $_; - last; - } - elsif (/\[\S+\]/i) - { - last; - } + s/^$var[ \t]*=[ \t]*//i; + $res = $_; + last; } } @@ -1269,7 +1261,7 @@ sub gst_parse_interfaces_option_tuple { while (($tuple = &gst_parse_interfaces_get_next_option ($fd)) != -1) { - if ($$tuple[0] eq $key) + if ($$tuple[0] =~ /$key/) { return $tuple if !$all; push @res, $tuple; |