projects
/
matthijs
/
upstream
/
backupninja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed partition check to use sfdisk as its more common
[matthijs/upstream/backupninja.git]
/
lib
/
parseini.in
diff --git
a/lib/parseini.in
b/lib/parseini.in
index 6f56d4228dc3efd1e44ef556bcd46dd14713d262..2f2124c49dd6137532302a7d11085e1d6c172bd3 100644
(file)
--- a/
lib/parseini.in
+++ b/
lib/parseini.in
@@
-1,3
+1,4
@@
+# -*- mode: awk; indent-tabs-mode: nil; -*-
#
# parseini --- parses 'ini' style configuration files.
#
#
# parseini --- parses 'ini' style configuration files.
#
@@
-8,27
+9,26
@@
#
# example ini file:
#
#
# example ini file:
#
-#
fruit = apple
-#
fruit = pear
-#
multiline = this is a multiline \
-#
parameter
+# fruit = apple
+# fruit = pear
+# multiline = this is a multiline \
+# parameter
#
#
-# # this is a comment
+# # this is a comment
+# [colors]
+# red = yes
+# green = no
+# blue = maybe
#
#
-# [colors]
-# red = yes
-# green = no
-# blue = maybe
-#
-# [ocean]
-# fish = red
-# fish = blue
+# [ocean]
+# fish = red
+# fish = blue
#
# example usage:
#
# example usage:
-#
> awk -f parseini S=ocean P=fish testfile.ini
+# > awk -f parseini S=ocean P=fish testfile.ini
# would return:
# would return:
-#
red
-#
blue
+# red
+# blue
#
BEGIN {
#
BEGIN {
@@
-119,7
+119,7
@@
END {
for (x = 0; x < nline; ++x) {
sub(/^[ \r\t]+/, "", line[x])
sub(/[ \r\t]+$/, "", line[x])
for (x = 0; x < nline; ++x) {
sub(/^[ \r\t]+/, "", line[x])
sub(/[ \r\t]+$/, "", line[x])
-
}
+ }
# output the final result
for (x = 0; x < nline; ++x)
# output the final result
for (x = 0; x < nline; ++x)