Subject: Buglet in FvwmAudio

From: [email-masked] (Albrecht Kadlec)
Date: Wed, 26 Jun 96 23:36:02 +0200

in FvwmAudio.c, Myname is used before definition,
the new builtin "string" was missing,
only the first parameter was given to the play command
(using the whole line is iseful for rsynth "say" or an arbitrary command)
being there I added an error message for unknown event mappings.

diff -c5 FvwmAudio.c.orig FvwmAudio.c
*** FvwmAudio.c.orig    Wed Jun 26 23:19:09 1996
--- FvwmAudio.c Wed Jun 26 23:27:32 1996
***************
*** 126,135 ****
--- 126,136 ----
        "error",
        "config_info",
        "end_config_info",
        "icon_file",
        "default_icon",
+       "string",
  /* add builtins here */
        "startup",
        "shutdown",
        "unknown"
  };
***************
*** 144,160 ****

  main(int argc, char **argv)
  {
        char *temp, *s;

-       if ((argc != 6)&&(argc != 7))
-       {
-               fprintf(stderr,"%s Version %s should only be executed by fvwm!\n",
-                       MyName, VERSION);
-               exit(1);
-       }
-
        /* Save our program  name - for error messages */
        temp = argv[0];
        s=strrchr(argv[0], '/');
        if (s != NULL)
                temp = s + 1;
--- 145,154 ----
***************
*** 161,170 ****
--- 155,171 ----

        MyName = safemalloc(strlen(temp)+2);
        strcpy(MyName,"*");
        strcat(MyName, temp);

+       if ((argc != 6)&&(argc != 7))
+       {
+               fprintf(stderr,"%s Version %s should only be executed by fvwm!\n",
+                       MyName+1, VERSION);
+               exit(1);
+       }
+
        /* Dead pipe == Fvwm died */
        signal (SIGPIPE, DeadPipe);

        fd[0] = atoi(argv[1]);
        fd[1] = atoi(argv[2]);
***************
*** 296,306 ****
              /*
               * *FvwmAudio <message_type> <audio_file>
               */
              else  {
                message = strtok(NULL, " \t");
!               sound = strtok(NULL, " \t");

                if (!message || !*message || !sound || !*sound)
                  {
                    continue;
                  }
--- 297,307 ----
              /*
               * *FvwmAudio <message_type> <audio_file>
               */
              else  {
                message = strtok(NULL, " \t");
!               sound = strtok(NULL, "\n");

                if (!message || !*message || !sound || !*sound)
                  {
                    continue;
                  }
***************
*** 321,330 ****
--- 322,332 ----
                      sound_table[i]=safemalloc(strlen(sound)+1);
                      strcpy(sound_table[i],sound);
                      found++;
                    }
                  }
+               if (!found) fprintf(stderr,"%s: %s not found\n",MyName+1,message);
              }
            }
        }
        GetConfigLine(fd,&buf);
      }

cheers,
albrecht
-- 
What happened to the heart that I gave you,
What are you hiding in your chest these days,
You wanted someone to save you,
I wanted someone who could not be saved.  -- The Hooters
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].