summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormattn <[email protected]>2012-12-11 11:44:09 +0900
committermattn <[email protected]>2012-12-11 11:44:09 +0900
commit90bd7371646ad7b800550de614e1d2035b2107e1 (patch)
treebe9ac9e18073c84c59d15148b21815d39318c5c0
parent57482ef3f04f158b9ec2f73369e1b697de8124c3 (diff)
downloadmruby-90bd7371646ad7b800550de614e1d2035b2107e1.tar.gz
mruby-90bd7371646ad7b800550de614e1d2035b2107e1.zip
fix generator.
-rw-r--r--mrbgems/generator.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mrbgems/generator.c b/mrbgems/generator.c
index 108405b24..915c2b914 100644
--- a/mrbgems/generator.c
+++ b/mrbgems/generator.c
@@ -28,7 +28,7 @@ static char
static char
*get_full_path(char *path, char *mruby_root)
{
- char full_path[1024] = { 0 };
+ static char full_path[1024] = { 0 };
if (path[0] == '/') {
/* An absolute UNIX path starts with a slash */
strcpy(full_path, path);
@@ -75,7 +75,7 @@ static char
}
}
- ret = malloc(i + count * (newlen - oldlen));
+ ret = malloc(i + count * (newlen - oldlen) + 1);
if (ret == NULL)
exit(EXIT_FAILURE);
@@ -184,6 +184,7 @@ for_each_gem (char before[1024], char after[1024],
skip = FALSE;
else
skip = TRUE;
+ fclose(check);
}
if (skip == FALSE)