]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* commands/i386/pc/play.c (grub_cmd_play): Call 'grub_file_open' only
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 28 Apr 2010 21:18:16 +0000 (23:18 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 28 Apr 2010 21:18:16 +0000 (23:18 +0200)
if argc is 1.

ChangeLog
commands/i386/pc/play.c

index c06df52d56d09a3d2184c6629da72d80840f5371..4c8f2b2f80adfddc7e83e9ed8c29aeb58fa47221 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2010-04-28  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
        * docs/grub.texi (play): Document that zero pitches produce rests.
+       * commands/i386/pc/play.c (grub_cmd_play): Call 'grub_file_open' only
+       if argc is 1.
 
 2010-04-27  Vladimir Serbinenko  <phcoder@gmail.com>
 
index 44d98a1f03e096a4a1ad84d328d9f6ab096494e4..4ed937d4a5b82b7d0b8df764b2ed6c16e9f5d315 100644 (file)
@@ -177,16 +177,20 @@ static grub_err_t
 grub_cmd_play (grub_command_t cmd __attribute__ ((unused)),
               int argc, char **args)
 {
-  grub_file_t file;
 
   if (argc < 1)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name or tempo and notes required");
 
-  file = grub_file_open (args[0]);
-  if (file)
+  if (argc == 1)
     {
       struct note buf;
       grub_uint32_t tempo;
+      grub_file_t file;
+
+      file = grub_file_open (args[0]);
+
+      if (! file)
+        return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
 
       if (grub_file_read (file, &tempo, sizeof (tempo)) != sizeof (tempo))
         {