You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/09/05 21:35:15 UTC
[1/3] git commit: Fix quoting in configure script
Repository: lucy-clownfish
Updated Branches:
refs/heads/master 3b32cceba -> 06eebd371
Fix quoting in configure script
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/900cd698
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/900cd698
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/900cd698
Branch: refs/heads/master
Commit: 900cd6982b25a6f5ec0ea7368bb8291f19d3b8b4
Parents: 3b32cce
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Fri Sep 5 21:14:03 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Fri Sep 5 21:14:03 2014 +0200
----------------------------------------------------------------------
compiler/c/configure | 2 +-
runtime/c/configure | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/900cd698/compiler/c/configure
----------------------------------------------------------------------
diff --git a/compiler/c/configure b/compiler/c/configure
index 412e707..4e8e47e 100755
--- a/compiler/c/configure
+++ b/compiler/c/configure
@@ -45,5 +45,5 @@ echo $command
$command || exit
echo Running charmonizer
-./charmonizer --cc=$CC --enable-c --enable-makefile $@
+./charmonizer --cc="$CC" --enable-c --enable-makefile "$@"
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/900cd698/runtime/c/configure
----------------------------------------------------------------------
diff --git a/runtime/c/configure b/runtime/c/configure
index ae1f4f9..29b0c14 100755
--- a/runtime/c/configure
+++ b/runtime/c/configure
@@ -48,5 +48,5 @@ echo $command
$command || exit
echo Running charmonizer
-./charmonizer --cc=$CC --enable-c --enable-makefile "$@"
+./charmonizer --cc="$CC" --enable-c --enable-makefile "$@"
[2/3] git commit: Regenerate charmonizer.c for whitespace fix
Posted by nw...@apache.org.
Regenerate charmonizer.c for whitespace fix
Part of CLOWNFISH-4.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/3b7eca28
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/3b7eca28
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/3b7eca28
Branch: refs/heads/master
Commit: 3b7eca28f1a7b91866ce7681bebb25f1a64219d2
Parents: 900cd69
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Fri Sep 5 21:22:35 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Fri Sep 5 21:28:19 2014 +0200
----------------------------------------------------------------------
compiler/common/charmonizer.c | 25 +++++++++++++++++++++++--
runtime/common/charmonizer.c | 25 +++++++++++++++++++++++--
2 files changed, 46 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b7eca28/compiler/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/compiler/common/charmonizer.c b/compiler/common/charmonizer.c
index 8a20531..b83481a 100644
--- a/compiler/common/charmonizer.c
+++ b/compiler/common/charmonizer.c
@@ -4496,6 +4496,7 @@ chaz_Make_list_files(const char *dir, const char *ext,
#include <stdarg.h>
#include <ctype.h>
#include <time.h>
+#include <errno.h>
/* #include "Charmonizer/Core/Compiler.h" */
/* #include "Charmonizer/Core/Util.h" */
@@ -4948,6 +4949,7 @@ chaz_Util_can_open_file(const char *file_path) {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
/* #include "Charmonizer/Probe.h" */
/* #include "Charmonizer/Core/HeaderChecker.h" */
/* #include "Charmonizer/Core/ConfWriter.h" */
@@ -5000,11 +5002,30 @@ chaz_Probe_parse_cli_args(int argc, const char *argv[],
args->code_coverage = 1;
}
else if (memcmp(arg, "--cc=", 5) == 0) {
- if (strlen(arg) > CHAZ_PROBE_MAX_CC_LEN - 5) {
+ size_t len = strlen(arg);
+ size_t l = 5;
+ size_t r = len;
+ size_t trimmed_len;
+
+ if (len > CHAZ_PROBE_MAX_CC_LEN - 5) {
fprintf(stderr, "Exceeded max length for compiler command");
exit(1);
}
- strcpy(args->cc, arg + 5);
+
+ /*
+ * Some Perl setups have a 'cc' config value with leading
+ * whitespace.
+ */
+ while (isspace(arg[l])) {
+ ++l;
+ }
+ while (r > l && isspace(arg[r-1])) {
+ --r;
+ }
+
+ trimmed_len = r - l;
+ memcpy(args->cc, arg + l, trimmed_len);
+ args->cc[trimmed_len] = '\0';
}
} /* preserve value of i */
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3b7eca28/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.c b/runtime/common/charmonizer.c
index dff9b8d..e953486 100644
--- a/runtime/common/charmonizer.c
+++ b/runtime/common/charmonizer.c
@@ -4496,6 +4496,7 @@ chaz_Make_list_files(const char *dir, const char *ext,
#include <stdarg.h>
#include <ctype.h>
#include <time.h>
+#include <errno.h>
/* #include "Charmonizer/Core/Compiler.h" */
/* #include "Charmonizer/Core/Util.h" */
@@ -4948,6 +4949,7 @@ chaz_Util_can_open_file(const char *file_path) {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
/* #include "Charmonizer/Probe.h" */
/* #include "Charmonizer/Core/HeaderChecker.h" */
/* #include "Charmonizer/Core/ConfWriter.h" */
@@ -5000,11 +5002,30 @@ chaz_Probe_parse_cli_args(int argc, const char *argv[],
args->code_coverage = 1;
}
else if (memcmp(arg, "--cc=", 5) == 0) {
- if (strlen(arg) > CHAZ_PROBE_MAX_CC_LEN - 5) {
+ size_t len = strlen(arg);
+ size_t l = 5;
+ size_t r = len;
+ size_t trimmed_len;
+
+ if (len > CHAZ_PROBE_MAX_CC_LEN - 5) {
fprintf(stderr, "Exceeded max length for compiler command");
exit(1);
}
- strcpy(args->cc, arg + 5);
+
+ /*
+ * Some Perl setups have a 'cc' config value with leading
+ * whitespace.
+ */
+ while (isspace(arg[l])) {
+ ++l;
+ }
+ while (r > l && isspace(arg[r-1])) {
+ --r;
+ }
+
+ trimmed_len = r - l;
+ memcpy(args->cc, arg + l, trimmed_len);
+ args->cc[trimmed_len] = '\0';
}
} /* preserve value of i */
[3/3] git commit: Don't quote argument to Perl's 'system' function
Posted by nw...@apache.org.
Don't quote argument to Perl's 'system' function
When using the multi-argument version of 'system', the shell isn't
invoked and arguments must not be quoted.
Should fix CLOWNFISH-4 together with the prvious commit.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/06eebd37
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/06eebd37
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/06eebd37
Branch: refs/heads/master
Commit: 06eebd371e452552db2d6aa700a2472cf6cd34d7
Parents: 3b7eca2
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Fri Sep 5 21:29:32 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Fri Sep 5 21:32:53 2014 +0200
----------------------------------------------------------------------
compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/06eebd37/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
index 36c0261..2e49e73 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
@@ -76,7 +76,7 @@ sub ACTION_charmony {
# Prepare arguments to charmonizer.
my @command = (
$CHARMONIZER_EXE_PATH,
- '--cc=' . _quotify( $self->config('cc') ),
+ '--cc=' . $self->config('cc'),
'--enable-c',
'--enable-perl',
);
@@ -108,13 +108,6 @@ sub charmony {
return;
}
-sub _quotify {
- my $string = shift;
- $string =~ s/\\/\\\\/g;
- $string =~ s/"/\\"/g;
- return $string =~ /\s/ ? qq|"$string"| : $string;
-}
-
1;
__END__