+ len = 17; /* strlen("xscreensaver-text") */
+ if (oprogram_size >= len &&
+ !memcmp (oprogram, "xscreensaver-text", len) &&
+ (oprogram[len] == ' ' || !oprogram[len]))
+ {
+ /* strstr is sloppy here. Technically, we should be parsing the command
+ line to identify flags and their arguments. This will blow up if one
+ of those pesky end users could set .textLiteral to "--cols".
+ */
+ if (d->char_w && !strstr (oprogram, "--cols "))
+ sprintf (s, " --cols %d", d->char_w);
+ if (d->max_lines && !strstr (oprogram, "--lines "))
+ sprintf (s, " --lines %d", d->max_lines);
+ s += strlen(s);
+
+# ifdef HAVE_COCOA
+ /* Also special-case "xscreensaver-text" to specify the text content on
+ the command line. defaults(1) on macOS doesn't know about the default
+ screenhack resources that don't make it into the
+ ~/Library/Preferences/ByHost/org.jwz.xscreensaver.*.plist.
+ */
+
+ char *text_mode_flag = " --date";
+ char *value_res = NULL;
+ char *text_mode = get_string_resource (d->dpy, "textMode", "String");
+
+ if (text_mode)
+ {
+ if (!strcmp (text_mode, "1") || !strcmp (text_mode, "literal"))
+ {
+ text_mode_flag = " --text";
+ value_res = "textLiteral";
+ }
+ else if (!strcmp (text_mode, "2") || !strcmp (text_mode, "file"))
+ {
+ text_mode_flag = " --file";
+ value_res = "textFile";
+ }
+ else if (!strcmp (text_mode, "3") || !strcmp (text_mode, "url"))
+ {
+ text_mode_flag = " --url";
+ value_res = "textURL";
+ }
+ else if (!strcmp (text_mode, "4") || !strcmp (text_mode, "program"))
+ {
+ text_mode_flag = " --program";
+ value_res = "textProgram";
+ }