Skip to content
Snippets Groups Projects
Commit 5fe09657 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Merge branch 'aggraef/purr-data-testing'

parents c2207cf0 a20505de
No related branches found
No related tags found
No related merge requests found
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment