Commit 6af6311f authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

improve readability of preferences reader script for OSX

parent f62125fd
......@@ -326,7 +326,14 @@ static void sys_initloadpreferences(void)
// "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'", prefs);
snprintf(cmdbuf, MAXPDSTRING,
"defaults export %s - "
"| plutil -convert json -r -o - - "
"| sed -E "
"-e 's/[{}]//g' "
"-e 's/^ *\"(([^\"]|\\\\.)*)\" *: *\"(([^\"]|\\\\.)*)\".*/\\1: \\3/' "
"-e 's/\\\\(.)/\\1/g'",
prefs);
// open the pipe
fp = popen(cmdbuf, "r");
if (!fp) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment