~ubuntu-branches/ubuntu/quantal/sgt-puzzles/quantal

« back to all changes in this revision

Viewing changes to debian/patches/101_fix-keen-div-error.diff

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings
  • Date: 2011-03-01 04:16:54 UTC
  • mfrom: (1.2.9 upstream)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20110301041654-949qy9qrroziy7vq
* New upstream version:
  - Add Range and Signpost puzzles
  - Use stock icons and conventional order for dialog buttons
  - Use Cairo for screen rendering
* Update German translation, thanks to Helge Kreutzmann
* Remove or update patches applied or partially applied upstream
* Use Debian source format 3.0 (quilt)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff --git a/keen.c b/keen.c
2
 
index fe41496..bec5055 100644
3
 
--- a/keen.c
4
 
+++ b/keen.c
5
 
@@ -1450,11 +1450,12 @@ static int check_errors(game_state *state, long *errors)
6
 
                break;
7
 
              case C_DIV:
8
 
                {
9
 
-                   int d1 = cluevals[j], d2 = state->grid[i];
10
 
-                   if (d1 == 0 || d2 == 0)
11
 
+                   int d1 = min(cluevals[j], state->grid[i]);
12
 
+                   int d2 = max(cluevals[j], state->grid[i]);
13
 
+                   if (d1 == 0 || d2 % d1 != 0)
14
 
                        cluevals[j] = 0;
15
 
                    else
16
 
-                       cluevals[j] = d2/d1 + d1/d2;/* one of them is 0 :-) */
17
 
+                       cluevals[j] = d2 / d1;
18
 
                }
19
 
                break;
20
 
            }