From 2174a7ff65bcf29eb6f6a40d8e2a2e5a068cb27f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 27 Jan 2007 02:21:21 +0000 Subject: [PATCH] Small optimization. --- ChangeLog | 7 +++++++ lib/javacomp.c | 7 +++++-- modules/javacomp | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8d0cbc5f..a6cd22503 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2007-01-26 Bruno Haible + Small optimization. + * lib/javacomp.c: Include c-strstr.h. + (is_envjavac_gcj): Use c_strstr instead of strstr. + * modules/javacomp (Depends-on): Add c-strstr, remove strstr. + +2007-01-26 Bruno Haible + * MODULES.html.sh (Unicode string functions): Add the new modules. * modules/uniconv/u32-strconv-to-locale: New file. diff --git a/lib/javacomp.c b/lib/javacomp.c index 3e0ca1b96..caff268a4 100644 --- a/lib/javacomp.c +++ b/lib/javacomp.c @@ -1,5 +1,5 @@ /* Compile a Java program. - Copyright (C) 2001-2003, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -48,6 +48,7 @@ #include "clean-temp.h" #include "error.h" #include "xvasprintf.h" +#include "c-strstr.h" #include "gettext.h" #define _(str) gettext (str) @@ -572,7 +573,9 @@ is_envjavac_gcj (const char *javac) fclose (fp); goto failed; } - envjavac_gcj = (strstr (line, "gcj") != NULL); + /* It is safe to call c_strstr() instead of strstr() here; see the + comments in c-strstr.h. */ + envjavac_gcj = (c_strstr (line, "gcj") != NULL); fclose (fp); diff --git a/modules/javacomp b/modules/javacomp index b1467d81e..12d030bc1 100644 --- a/modules/javacomp +++ b/modules/javacomp @@ -25,7 +25,7 @@ fwriteerror clean-temp error xvasprintf -strstr +c-strstr gettext-h javacomp-script -- 2.11.0