# [PATCH] Solaris needs strings.h when using index().

3 messages from 2006-04-04 to 2006-04-04. Participants: Peter Eriksen, Junio C Hamano, H. Peter Anvin.
Thread: https://gitlist.dev/t/3790

## Peter Eriksen, 2006-04-04 12:36

Subject: [PATCH] Solaris needs strings.h when using index().
Message-ID: <20060404123603.GA14071@bohr.gbar.dtu.dk>
URL: https://gitlist.dev/e/20060404123603.GA14071%40bohr.gbar.dtu.dk

```
From: Peter Eriksen <s022018@student.dtu.dk>
Date: Tue Apr 4 14:33:14 2006 +0200
Subject: [PATCH] Solaris needs strings.h when using index().

Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>


---


 blame.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

832067e6e16ae6c1ac3bd043ddeb56daa993e682
diff --git a/blame.c b/blame.c
index 396defc..1a08434 100644
--- a/blame.c
+++ b/blame.c
@@ -6,6 +6,7 @@ #include <assert.h>
 #include <time.h>
 #include <sys/time.h>
 #include <math.h>
+#include <strings.h>
 
 #include "cache.h"
 #include "refs.h"
-- 
1.3.0.rc1.gfc99-dirty

```

## Junio C Hamano, 2006-04-04 18:18

Subject: Re: [PATCH] Solaris needs strings.h when using index().
Message-ID: <7vwte56w7n.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vwte56w7n.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060404123603.GA14071@bohr.gbar.dtu.dk>

```
"Peter Eriksen" <s022018@student.dtu.dk> writes:

> From: Peter Eriksen <s022018@student.dtu.dk>
> Date: Tue Apr 4 14:33:14 2006 +0200
> Subject: [PATCH] Solaris needs strings.h when using index().
>
> Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>

I think somebody else noticed this the other day but I'm
undecided if it is easier to replace use of index with strchr,
since we include <string.h> and use strchr() everywhere.

```

## H. Peter Anvin, 2006-04-04 18:44

Subject: Re: [PATCH] Solaris needs strings.h when using index().
Message-ID: <4432BE8D.3030504@zytor.com>
URL: https://gitlist.dev/e/4432BE8D.3030504%40zytor.com
In-Reply-To: <7vwte56w7n.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano wrote:
> "Peter Eriksen" <s022018@student.dtu.dk> writes:
> 
>> From: Peter Eriksen <s022018@student.dtu.dk>
>> Date: Tue Apr 4 14:33:14 2006 +0200
>> Subject: [PATCH] Solaris needs strings.h when using index().
>>
>> Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
> 
> I think somebody else noticed this the other day but I'm
> undecided if it is easier to replace use of index with strchr,
> since we include <string.h> and use strchr() everywhere.
> 

strchr() is definitely more portable.  The further away you get from BSD 
heritage, the less likely it is that you're going to see bzero, index, 
et al whereas anything even remotely modern has memset, strchr, etc.

	-hpa

```
