Your message dated Sun, 12 Aug 2007 03:47:02 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#418019: fixed in moon-lander 1:1.0-4
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: moon-lander
Version: 1:1.0-3
Severity: normal
Tags: patch

Hi,
moon-lander starts up for me but dies when I press enter to start to
play:
,-----------------
| [EMAIL PROTECTED] moon-lander
| Sound active
| reading game options in /home/greek0/.moon_lander
| cannot open file for reading: /home/greek0/.moon_lander - loading defaults
| open /dev/sequencer: No such file or directory
| Opened audio at 22050 Hz 16 bit stereoscreen initialized
| Loaded font "/usr/share/games/moon-lander/fonts/ConsoleFont.bmp". Width:6, 
Height:13
| Loaded font "/usr/share/games/moon-lander/fonts/LargeFont.bmp". Width:16, 
Height:18
| Couldn't load /usr/share/games/moon-lander/images/backgrounds/..: Unsupported 
image format
`-----------------

Relevant code paths are in get_new_background():
,-----------------
|     while (!done){
|       if ( files[count] = readdir(dir) ){
|       
|         //printf("I see - %d %s\n", count, files[count]->d_name);
|         count++;
|       }
|       else{
|         done = 1;
|       }
|     
|       if (count > 99) {
|         done = 1;
|       }
|     }
| 
|   /** ... some more code ... **/
| 
|   if (game->back_no < 2){
|     game->back_no = 2;
|   }
| 
|   if (game->back_no >= count){
|     game->back_no = 2;
|   }
`-----------------

readdir() gives back all the directory entries, including "." and
"..". Those are supposed to be filtered out later by the
game->back_no < 2 check. Unfortunately readdir() doesn't give back
"." and ".." as the first 2 entries on my system:
,-----------------
| I see - 0 fingers.jpg
| I see - 1 .
| I see - 2 ..
| I see - 3 earth_moon.jpg
| I see - 4 orange_gas.jpg
| I see - 5 blue_nebula.jpg
| I see - 6 fire_and_planet.jpg
| I see - 7 saturn.jpg
| I see - 8 red_plain.jpg
| I see - 9 glowing_nebula.jpg
`-----------------

So the game tries to open "..", which doesn't work, causing
moon-lander to die.

I've attached a patch fixing this by checking in the while loop if
the dirent return by readdir() corresponds to a directory. If so
it's ignored. The two if's have been changed too, so all available
images are cycled.

Cheers,
Christian Aichinger


-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.17.4-vs2.1.1-rc23-iphigenie
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)

Versions of packages moon-lander depends on:
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  libsdl-image1.2             1.2.5-3      image loading library for Simple D
ii  libsdl-mixer1.2             1.2.6-2      mixer library for Simple DirectMed
ii  libsdl1.2debian             1.2.11-8     Simple DirectMedia Layer
ii  moon-lander-data            1:1.0-3      Data files (sound, images) for moo

moon-lander recommends no packages.

-- no debconf information
--- moon-lander-1.0.orig/moon_lander.c	2007-03-10 23:07:38.000000000 +0100
+++ moon-lander-1.0/moon_lander.c	2007-03-10 23:14:50.000000000 +0100
@@ -197,6 +197,8 @@
     while (!done){
       if ( files[count] = readdir(dir) ){
       
+	if ( files[count]->d_type & DT_DIR )
+	  continue;
 	//printf("I see - %d %s\n", count, files[count]->d_name);
 	count++;
       }
@@ -222,12 +224,12 @@
 
   game->back_no++;
   
-  if (game->back_no < 2){
-    game->back_no = 2;
+  if (game->back_no < 0){
+    game->back_no = 0;
   }
 
   if (game->back_no >= count){
-    game->back_no = 2;
+    game->back_no = 0;
   }
   
 

--- End Message ---
--- Begin Message ---
Source: moon-lander
Source-Version: 1:1.0-4

We believe that the bug you reported is fixed in the latest version of
moon-lander, which is due to be installed in the Debian FTP archive:

moon-lander-data_1.0-4_all.deb
  to pool/main/m/moon-lander/moon-lander-data_1.0-4_all.deb
moon-lander_1.0-4.diff.gz
  to pool/main/m/moon-lander/moon-lander_1.0-4.diff.gz
moon-lander_1.0-4.dsc
  to pool/main/m/moon-lander/moon-lander_1.0-4.dsc
moon-lander_1.0-4_i386.deb
  to pool/main/m/moon-lander/moon-lander_1.0-4_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Joe Nahmias <[EMAIL PROTECTED]> (supplier of updated moon-lander package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Fri, 10 Aug 2007 00:49:35 -0400
Source: moon-lander
Binary: moon-lander-data moon-lander
Architecture: source i386 all
Version: 1:1.0-4
Distribution: unstable
Urgency: low
Maintainer: Joe Nahmias <[EMAIL PROTECTED]>
Changed-By: Joe Nahmias <[EMAIL PROTECTED]>
Description: 
 moon-lander - An SDL game based on the classic moon lander
 moon-lander-data - Data files (sound, images) for moon-lander
Closes: 304115 347240 418019
Changes: 
 moon-lander (1:1.0-4) unstable; urgency=low
 .
   * Add remaining fuel to score, closes: #347240.
   * When choosing a background, skip anything other than a regular file,
     closes: #418019.
   * moon-lander-data: recommend moon-lander.
   * moon-lander-data: remove obsolete conflict, it's not even available in
     oldstable (sarge).
   * Don't build moon-lander-data in binary-arch target, closes: #304115.
   * Update menu section to comply with new policy: Arcade => Action.
Files: 
 0f2de75115cd2f5a35f8676ad96beb64 663 games optional moon-lander_1.0-4.dsc
 ea466c6463be10f96f986439a26747db 6171 games optional moon-lander_1.0-4.diff.gz
 6f544e3f3edd51223521c4900beb6205 22126 games optional 
moon-lander_1.0-4_i386.deb
 48a8e8c2af606a3ebf038c0ac159f2cb 1332702 games optional 
moon-lander-data_1.0-4_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGvn8rULacnzmLNx0RAmyaAKCEaLi7+2S6UjghBtx3mCCRYMkRoQCgkpgH
VYJN7OQwJ3i8bpacJAJwtUI=
=ll7O
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to