From 66c4509b73eeb66de3196a43e3171b3764f74100 Mon Sep 17 00:00:00 2001 From: Dennis Stosberg Date: Tue, 15 Aug 2006 11:01:22 +0200 Subject: Solaris does not support C99 format strings before version 10 Signed-off-by: Dennis Stosberg Signed-off-by: Junio C Hamano diff --git a/Makefile b/Makefile index 0761d6c..02a036b 100644 --- a/Makefile +++ b/Makefile @@ -301,10 +301,12 @@ ifeq ($(uname_S),SunOS) NEEDS_LIBICONV = YesPlease NO_UNSETENV = YesPlease NO_SETENV = YesPlease + NO_C99_FORMAT = YesPlease endif ifeq ($(uname_R),5.9) NO_UNSETENV = YesPlease NO_SETENV = YesPlease + NO_C99_FORMAT = YesPlease endif INSTALL = ginstall TAR = gtar -- cgit v0.10.2-6-g49f6 From 1d6249e609289940dca179b626fe4ae5433c90cc Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 16 Aug 2006 02:20:32 +0200 Subject: git-mv: succeed even if source is a prefix of destination As noted by Fredrik Kuivinen, without this patch, git-mv fails on git-mv README README-renamed because "README" is a prefix of "README-renamed". Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano diff --git a/builtin-mv.c b/builtin-mv.c index a731f8d..e7b5eb7 100644 --- a/builtin-mv.c +++ b/builtin-mv.c @@ -119,6 +119,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix) /* Checking */ for (i = 0; i < count; i++) { + int length; const char *bad = NULL; if (show_only) @@ -204,7 +205,9 @@ int cmd_mv(int argc, const char **argv, const char *prefix) } if (!bad && - !strncmp(destination[i], source[i], strlen(source[i]))) + (length = strlen(source[i])) >= 0 && + !strncmp(destination[i], source[i], length) && + (destination[i][length] == 0 || destination[i][length] == '/')) bad = "can not move directory into itself"; if (!bad && cache_name_pos(source[i], strlen(source[i])) < 0) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 900ca93..e5e0bb9 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -60,6 +60,10 @@ test_expect_success \ grep -E "^R100.+path0/README.+path2/README"' test_expect_success \ + 'succeed when source is a prefix of destination' \ + 'git-mv path2/COPYING path2/COPYING-renamed' + +test_expect_success \ 'moving whole subdirectory into subdirectory' \ 'git-mv path2 path1' -- cgit v0.10.2-6-g49f6 From 53e1a761be8d338cd957870bc1e48a8c15d7d2c0 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 15 Aug 2006 16:28:08 -0700 Subject: finish_connect(): thinkofix All but one callers have ignore the return value from this function, but the only caller, builtin-tar-tree.c::remote_tar(), assumed it returns non-zero on failure and zero on success. The implementation however was returning either the waited pid (which must be the same as its input) or -1 (an error). Fix this thinko, while getting rid of an assignment of return value from waitpid() into a variable of type int. Signed-off-by: Junio C Hamano diff --git a/connect.c b/connect.c index 4422a0d..b9c2220 100644 --- a/connect.c +++ b/connect.c @@ -737,14 +737,9 @@ int git_connect(int fd[2], char *url, const char *prog) int finish_connect(pid_t pid) { - int ret; - - for (;;) { - ret = waitpid(pid, NULL, 0); - if (!ret) - break; + while (waitpid(pid, NULL, 0) < 0) { if (errno != EINTR) - break; + return -1; } - return ret; + return 0; } -- cgit v0.10.2-6-g49f6