File: parse-config-new

package info (click to toggle)
dosemu 1.4.0%2Bsvn.1999-2
  • links: PTS
  • area: contrib
  • in suites: squeeze
  • size: 15,552 kB
  • ctags: 22,600
  • sloc: ansic: 136,915; asm: 4,107; sh: 1,606; perl: 1,411; makefile: 974; tcl: 599; awk: 404; yacc: 300; lex: 157
file content (21 lines) | stat: -rw-r--r-- 523 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /usr/bin/awk -f
#
# Parse the DOSEmu configuration file.
#

{
  var_end = index ($0, "=");
  var_type = substr ($0, 1, 1);
  var_name = substr ($0, 5, var_end -6);
  var_value = substr ($0, var_end+2, length($0) - var_end -1);

  if ( var_value ~ /^[\"\'\(][^\"\'\)]*[\"\'\)]$/ ) {
    if (substr (var_value, 2, 1) != "$") {
      var_value = substr (var_value, 2, length(var_value) - 2);
    }
  }
       
#  write_entry(var_name, var_type, escape_string(var_value) );
  write_entry(var_name, var_type, var_value );
}