X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fphosphor.c;h=e133a12f28c99a6a0fea019034e768ee454df2d2;hp=c01f5a5a17b7e37aaac8b749483f1c49720ef078;hb=ccb7f4903325f92555a9722bba74b58346654ba0;hpb=0d6b320def9180cf907ceaed56b23a972a11b757 diff --git a/hacks/phosphor.c b/hacks/phosphor.c index c01f5a5a..e133a12f 100644 --- a/hacks/phosphor.c +++ b/hacks/phosphor.c @@ -1144,10 +1144,18 @@ launch_text_generator (p_state *state) char *oprogram = get_string_resource ("program", "Program"); char *program = (char *) malloc (strlen (oprogram) + 50); - /* oprogram contains a "%d" where the current number of columns goes - */ strcpy (program, "( "); - sprintf (program + strlen(program), oprogram, state->grid_width-1); + strcat (program, oprogram); + + /* Kludge! Special-case "xscreensaver-text" to tell it how wide + the screen is. We used to do this by just always feeding + `program' through sprintf() and setting the default value to + "xscreensaver-text --cols %d", but that makes things blow up + if someone ever uses a --program that includes a % anywhere. + */ + if (!strcmp (oprogram, "xscreensaver-text")) + sprintf (program + strlen(program), " --cols %d", state->grid_width-1); + strcat (program, " ) 2>&1"); #ifdef HAVE_FORKPTY @@ -1395,7 +1403,7 @@ char *defaults [] = { "*ticks: 20", "*delay: 50000", "*cursor: 333", - "*program: xscreensaver-text --cols %d", + "*program: xscreensaver-text", "*relaunch: 5", "*metaSendsESC: True", "*swapBSDEL: True",