Some older GCC compilers don't like that variables are declared
in the middle of the code, and expect them on the top in the
block/scope.
Trac-ticket: 99
Signed-off-by: Simon Matter <simon.matter@invoca.ch>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
static char *
searchandreplace(const char *tosearch, const char *searchfor, const char *replacewith)
{
- if (!tosearch || !searchfor || !replacewith) return 0;
- if (!strlen(tosearch) || !strlen(searchfor) || !strlen(replacewith)) return 0;
-
const char *searching=tosearch;
char *scratch;
char temp[strlen(tosearch)*10];
temp[0]=0;
+ if (!tosearch || !searchfor || !replacewith) return 0;
+ if (!strlen(tosearch) || !strlen(searchfor) || !strlen(replacewith)) return 0;
+
scratch = strstr(searching,searchfor);
if (!scratch) return strdup(tosearch);