On Mon, 3 Aug 2009, Peter Breitenlohner wrote:

the handling of slocate databases in locate.c is (1) unnecessarily
complicated, and (2) assumes that the second path is an extension of the
first one.  This may or may not be true.

Attached are two patches:

Hi,

sorry, this should have been three patches.

0002-slocate-*: adds a test case exposing the bug.

0003-slocate-*: simplifies the handling of slocate databases, also fixing
the bug.

Here the missing patch:

0006-slocate-*: reindent and fix a typo.

Regards
Peter Breitenlohner <[email protected]>
From ea5cd4527b8417cbf1eaf67092e9b853b7802830 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <[email protected]>
Date: Tue, 4 Aug 2009 10:42:18 +0200
Subject: [PATCH 6/6] slocate: reindent and fix typo


Signed-off-by: Peter Breitenlohner <[email protected]>
---
 locate/locate.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/locate/locate.c b/locate/locate.c
index d73354c..804086b 100644
--- a/locate/locate.c
+++ b/locate/locate.c
@@ -562,16 +562,16 @@ visit_locate02_format(struct process_data *procdata, void 
*context)
   int nread;
   (void) context;
 
-      if (procdata->c == LOCATEDB_ESCAPE)
-       procdata->count += (short)get_short (procdata->fp);
-      else if (procdata->c > 127)
-       procdata->count += procdata->c - 256;
-      else
-       procdata->count += procdata->c;
+  if (procdata->c == LOCATEDB_ESCAPE)
+    procdata->count += (short)get_short (procdata->fp);
+  else if (procdata->c > 127)
+    procdata->count += procdata->c - 256;
+  else
+    procdata->count += procdata->c;
 
   if (procdata->count > procdata->len || procdata->count < 0)
     {
-      /* This should not happen generally , but since we're
+      /* This should not happen generally, but since we're
        * reading in data which is outside our control, we
        * cannot prevent it.
        */
-- 
1.6.4

Reply via email to