Revision: | 1.1.1.1 (vendor branch) |
Committed: | Fri Feb 3 07:14:46 2006 UTC (18 years, 5 months ago) by root |
Branch: | UPSTREAM |
CVS Tags: | UPSTREAM_2006_03_15, LAST_C_VERSION, STABLE, UPSTREAM_2006_02_22, difficulty_fix_merge_060810_2300, UPSTREAM_2006_02_03 |
Branch point for: | difficulty_fix |
Changes since 1.1: | +0 -0 lines |
Log Message: | initial import |
# | User | Rev | Content |
---|---|---|---|
1 | root | 1.1 | #!/bin/sh |
2 | # | ||
3 | # ad2c : Convert app-defaults file to C strings decls. | ||
4 | # | ||
5 | # George Ferguson, ferguson@cs.rcohester.edu, 12 Nov 1990. | ||
6 | # Updated 19 Mar 1991 - Made it self-contained. | ||
7 | # | ||
8 | |||
9 | sed -n ' | ||
10 | : read | ||
11 | # remove comments | ||
12 | /^!/d | ||
13 | # remove blanks | ||
14 | /^$/d | ||
15 | # escape quotes | ||
16 | s/"/\\"/g | ||
17 | # escape backslash | ||
18 | s/\\/\\\\/g | ||
19 | # except the line continuation ones | ||
20 | s/\\$//g | ||
21 | # add leading quote | ||
22 | s/^/"/ | ||
23 | # | ||
24 | : test | ||
25 | /\\$/b slash | ||
26 | s/$/",/ | ||
27 | p | ||
28 | n | ||
29 | b read | ||
30 | # | ||
31 | : slash | ||
32 | p | ||
33 | n | ||
34 | # just like "read" only does not add leading quote | ||
35 | /^!/d | ||
36 | /^$/d | ||
37 | s/"/\\"/g | ||
38 | s/\\\\/\\/g | ||
39 | s/\\n/\\\\n/g | ||
40 | s/\\t/\\\\t/g | ||
41 | s/\\f/\\\\f/g | ||
42 | s/\\b/\\\\b/g | ||
43 | b test' "$@" |