-/* xscreensaver, Copyright (c) 1992 Jamie Zawinski <jwz@lucid.com>
+/* xscreensaver, Copyright (c) 1992 Jamie Zawinski <jwz@netscape.com>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
words = get_words();
}
+static int first_time = 1;
+
static char *
get_words()
{
switch (getwordsfrom)
{
case FROM_PROGRAM:
- if (pp = popen(program, "r"))
+ if ((pp = popen(program, "r")))
{
while (fgets(p, sizeof(buf) - strlen(buf), pp))
{
(void) pclose(pp);
if (! buf[0])
sprintf (buf, "\"%s\" produced no output!", orig_program);
+ else if (!first_time &&
+ (strstr (buf, ": not found") ||
+ strstr (buf, ": Not found")))
+ switch (random () % 20)
+ {
+ case 1: strcat (buf, "( Get with the program, bub. )\n");
+ break;
+ case 2: strcat (buf,
+ "( I blow my nose at you, you silly person! ) \n"); break;
+ case 3: strcat (buf,
+ "\nThe resource you want to\nset is `noseguy.program'\n");
+ break;
+ case 4:
+ strcat(buf,"\nHelp!! Help!!\nAAAAAAGGGGHHH!! \n\n"); break;
+ case 5: strcpy (buf, "You have new mail.\n"); break;
+ case 6:
+ strcat(buf,"( Hello? Are you paying attention? )\n");break;
+ case 7:
+ strcat (buf, "sh: what kind of fool do you take me for? \n");
+ break;
+ }
+ first_time = 0;
p = buf;
}
else
}
break;
case FROM_FILE:
- if (pp = fopen(filename, "r"))
+ if ((pp = fopen(filename, "r")))
{
while (fgets(p, sizeof(buf) - strlen(buf), pp))
{
char *progclass = "Noseguy";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ "Noseguy.background: black", /* to placate SGI */
+ "Noseguy.foreground: white",
"*mode: program",
"*program: fortune -s",
"noseguy.font: -*-new century schoolbook-*-r-*-*-*-180-*-*-*-*-*-*",
{
list = XListFonts(dpy, FONT_NAME, 32767, &foo);
for (i = 0; i < foo; i++)
- if (font = XLoadQueryFont(dpy, list[i]))
+ if ((font = XLoadQueryFont(dpy, list[i])))
break;
if (!font)
{