Small optimization.
authorBruno Haible <bruno@clisp.org>
Sat, 27 Jan 2007 02:21:21 +0000 (02:21 +0000)
committerBruno Haible <bruno@clisp.org>
Sat, 27 Jan 2007 02:21:21 +0000 (02:21 +0000)
ChangeLog
lib/javacomp.c
modules/javacomp

index f8d0cbc5f0b93606801a533e8e5a724451f6f49d..a6cd2250348f8b09182a319cc16bf40abd38cc8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-01-26  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        * MODULES.html.sh (Unicode string functions): Add the new modules.
index 3e0ca1b96170445934ada893498d628ae9617764..caff268a40cf13a38258c063a1b988107e9b3f64 100644 (file)
@@ -1,5 +1,5 @@
 /* Compile a Java program.
-   Copyright (C) 2001-2003, 20062007 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2006-2007 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 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);
 
index b1467d81e242cfa3ff9b3a431632bfc0a729fed1..12d030bc1588468a80284de93fdbe65b5b72864c 100644 (file)
@@ -25,7 +25,7 @@ fwriteerror
 clean-temp
 error
 xvasprintf
-strstr
+c-strstr
 gettext-h
 javacomp-script