Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Aayush
purr-data
Commits
5fe09657
Commit
5fe09657
authored
Jan 23, 2017
by
Jonathan Wilkes
Browse files
Merge branch 'aggraef/purr-data-testing'
parents
c2207cf0
a20505de
Changes
1
Show whitespace changes
Inline
Side-by-side
pd/src/s_file.c
View file @
5fe09657
...
...
@@ -285,7 +285,14 @@ static void sys_initloadpreferences(void)
// 1. defaults export: grab our defaults in XML format
// 2. plutil -convert json -r -o - -: convert to JSON
// 3. sed: a few edits remove the extra JSON bits (curly brances, string
// quotes, unwanted whitespace and character escapes)
// quotes, unwanted whitespace and character escapes) and produce
// Pd-L2Ork's Unix prefs format, i.e.:
// JSON --> Unix prefs
// {
// "nloadlib" : "33", nloadlib: 33
// "loadlib1" : "libdir", loadlib1: libdir
// "path1" : "\/System\/Library\/Fonts" path1: /System/Library/Fonts
// }
snprintf
(
cmdbuf
,
MAXPDSTRING
,
"defaults export %s - | plutil -convert json -r -o - - | sed -E -e 's/[{}]//g' -e 's/^ *
\"
(([^
\"
]|
\\\\
.)*)
\"
*: *
\"
(([^
\"
]|
\\\\
.)*)
\"
.*/
\\
1:
\\
3/' -e 's/
\\\\
(.)/
\\
1/g'"
,
current_prefs
);
// open the pipe
fp
=
popen
(
cmdbuf
,
"r"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment