<body class="article">\r
<div id="header">\r
<h1>ccache authors</h1>\r
-<span id="revnumber">version 3.2.3</span>\r
+<span id="revnumber">version 3.2.4</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</li>\r
<li>\r
<p>\r
+Vadim Petrochenkov <<a href="mailto:vadim.petrochenkov@gmail.com">vadim.petrochenkov@gmail.com</a>>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
Ville Skyttä <<a href="mailto:ville.skytta@iki.fi">ville.skytta@iki.fi</a>>\r
</p>\r
</li>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.2.3<br />\r
+Version 3.2.4<br />\r
Last updated\r
- 2015-08-16 14:11:14 CEST\r
+ 2015-10-08 21:10:53 CEST\r
</div>\r
</div>\r
</body>\r
* Ryan Brown <ryb@ableton.com>
* Tim Potter <tpot@samba.org>
* Tor Arne Vestbø <torarnv@gmail.com>
+* Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
* Ville Skyttä <ville.skytta@iki.fi>
* William S Fulton <wsf@fultondesigns.co.uk>
* Wilson Snyder <wsnyder@wsnyder.org>
RANLIB = @RANLIB@
all_cflags = $(CFLAGS)
-all_cppflags = @DEFS@ @extra_cppflags@ -DSYSCONFDIR=$(sysconfdir) -I. -I$(srcdir) $(CPPFLAGS)
-all_ldflags = @extra_ldflags@ $(LDFLAGS)
+all_cppflags = @DEFS@ -DSYSCONFDIR=$(sysconfdir) -I. -I$(srcdir) $(CPPFLAGS)
extra_libs = @extra_libs@
base_sources = \
all: ccache$(EXEEXT)
ccache$(EXEEXT): $(ccache_objs) $(extra_libs)
- $(CC) $(all_cflags) -o $@ $(ccache_objs) $(all_ldflags) $(extra_libs) $(LIBS)
+ $(CC) $(all_cflags) -o $@ $(ccache_objs) $(LDFLAGS) $(extra_libs) $(LIBS)
.PHONY: install
install: all
test/main$(EXEEXT)
test/main$(EXEEXT): $(base_objs) $(test_objs) $(extra_libs)
- $(CC) $(all_cflags) -o $@ $(base_objs) $(test_objs) $(all_ldflags) $(extra_libs) $(LIBS)
+ $(CC) $(all_cflags) -o $@ $(base_objs) $(test_objs) $(LDFLAGS) $(extra_libs) $(LIBS)
test/main.o: test/suites.h
<body class="article">\r
<div id="header">\r
<h1>ccache news</h1>\r
-<span id="revnumber">version 3.2.3</span>\r
+<span id="revnumber">version 3.2.4</span>\r
<div id="toc">
<div id="toctitle">Table of Contents</div>
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>\r
<div id="content">\r
<div class="sect1">\r
+<h2 id="_ccache_3_2_4">ccache 3.2.4</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Release date: 2015-10-08</p></div>\r
+<div class="sect2">\r
+<h3 id="_bug_fixes">Bug fixes</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Fixed build error related to zlib on systems with older make versions\r
+ (regression in ccache 3.2.3).\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Made conversion-to-bool explicit to avoid build warnings (and potential\r
+ runtime errors) on legacy systems.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Improved signal handling: Kill compiler on SIGTERM; wait for compiler to exit\r
+ before exiting; die appropriately.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Minor fixes related to Windows support.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+The correct compression level is now used if compression is requested.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed a bug where cache cleanup could be run too early for caches larger than\r
+ 64 GiB on 32-bit systems.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
<h2 id="_ccache_3_2_3">ccache 3.2.3</h2>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2015-08-16</p></div>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes">Bug fixes</h3>\r
+<h3 id="_bug_fixes_2">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_2">Bug fixes</h3>\r
+<h3 id="_bug_fixes_3">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2014-12-10</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_3">Bug fixes</h3>\r
+<h3 id="_bug_fixes_4">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_4">Bug fixes</h3>\r
+<h3 id="_bug_fixes_5">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2015-03-07</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_5">Bug fixes</h3>\r
+<h3 id="_bug_fixes_6">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_6">Bug fixes</h3>\r
+<h3 id="_bug_fixes_7">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2013-01-06</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_7">Bug fixes</h3>\r
+<h3 id="_bug_fixes_8">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_8">Bug fixes</h3>\r
+<h3 id="_bug_fixes_9">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2012-01-08</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_9">Bug fixes</h3>\r
+<h3 id="_bug_fixes_10">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_10">Bug fixes</h3>\r
+<h3 id="_bug_fixes_11">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_11">Bug fixes</h3>\r
+<h3 id="_bug_fixes_12">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2011-01-09</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_12">Bug fixes</h3>\r
+<h3 id="_bug_fixes_13">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-11-28</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_13">Bug fixes</h3>\r
+<h3 id="_bug_fixes_14">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-11-21</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_14">Bug fixes</h3>\r
+<h3 id="_bug_fixes_15">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-11-07</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_15">Bug fixes</h3>\r
+<h3 id="_bug_fixes_16">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_16">Bug fixes</h3>\r
+<h3 id="_bug_fixes_17">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div class="sectionbody">\r
<div class="paragraph"><p>Release date: 2010-07-15</p></div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_17">Bug fixes</h3>\r
+<h3 id="_bug_fixes_18">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
</ul></div>\r
</div>\r
<div class="sect2">\r
-<h3 id="_bug_fixes_18">Bug fixes</h3>\r
+<h3 id="_bug_fixes_19">Bug fixes</h3>\r
<div class="ulist"><ul>\r
<li>\r
<p>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Version 3.2.3<br />\r
+Version 3.2.4<br />\r
Last updated\r
- 2015-08-16 14:00:42 CEST\r
+ 2015-10-08 21:12:12 CEST\r
</div>\r
</div>\r
</body>\r
===========
+ccache 3.2.4
+------------
+Release date: 2015-10-08
+
+
+Bug fixes
+~~~~~~~~~
+
+- Fixed build error related to zlib on systems with older make versions
+ (regression in ccache 3.2.3).
+
+- Made conversion-to-bool explicit to avoid build warnings (and potential
+ runtime errors) on legacy systems.
+
+- Improved signal handling: Kill compiler on SIGTERM; wait for compiler to exit
+ before exiting; die appropriately.
+
+- Minor fixes related to Windows support.
+
+- The correct compression level is now used if compression is requested.
+
+- Fixed a bug where cache cleanup could be run too early for caches larger than
+ 64 GiB on 32-bit systems.
+
+
ccache 3.2.3
------------
Release date: 2015-08-16
.\" Title: ccache
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 08/16/2015
+.\" Date: 10/08/2015
.\" Manual: ccache Manual
-.\" Source: ccache 3.2.3
+.\" Source: ccache 3.2.4
.\" Language: English
.\"
-.TH "CCACHE" "1" "08/16/2015" "ccache 3\&.2\&.3" "ccache Manual"
+.TH "CCACHE" "1" "10/08/2015" "ccache 3\&.2\&.4" "ccache Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
/* Temporary files to remove at program exit. */
static struct pending_tmp_file *pending_tmp_files = NULL;
+static sigset_t fatal_signal_set;
+
+/* PID of currently executing compiler that we have started, if any. 0 means no
+ * ongoing compilation. */
+static pid_t compiler_pid = 0;
+
/*
* This is a string that identifies the current "version" of the hash sum
* computed by ccache. If, for any reason, we want to force the hash sum to be
return path;
}
+void
+block_signals(void)
+{
+ sigprocmask(SIG_BLOCK, &fatal_signal_set, NULL);
+}
+
+void
+unblock_signals(void)
+{
+ sigset_t empty;
+ sigemptyset(&empty);
+ sigprocmask(SIG_SETMASK, &empty, NULL);
+}
+
static void
add_pending_tmp_file(const char *path)
{
- struct pending_tmp_file *e = x_malloc(sizeof(*e));
+ struct pending_tmp_file *e;
+
+ block_signals();
+ e = x_malloc(sizeof(*e));
e->path = x_strdup(path);
e->next = pending_tmp_files;
pending_tmp_files = e;
+ unblock_signals();
}
static void
-clean_up_pending_tmp_files(void)
+do_clean_up_pending_tmp_files(void)
{
struct pending_tmp_file *p = pending_tmp_files;
while (p) {
}
static void
-signal_handler(int signo)
+clean_up_pending_tmp_files(void)
{
- (void)signo;
- clean_up_pending_tmp_files();
- _exit(1);
+ block_signals();
+ do_clean_up_pending_tmp_files();
+ unblock_signals();
+}
+
+static void
+signal_handler(int signum)
+{
+ /* Unregister handler for this signal so that we can send the signal to
+ * ourselves at the end of the handler. */
+ signal(signum, SIG_DFL);
+
+ /* If ccache was killed explicitly, then bring the compiler subprocess (if
+ * any) with us as well. */
+ if (signum == SIGTERM
+ && compiler_pid != 0
+ && waitpid(compiler_pid, NULL, WNOHANG) == 0) {
+ kill(compiler_pid, signum);
+ }
+
+ do_clean_up_pending_tmp_files();
+
+ if (compiler_pid != 0) {
+ /* Wait for compiler subprocess to exit before we snuff it. */
+ waitpid(compiler_pid, NULL, 0);
+ }
+
+ /* Resend signal to ourselves to exit properly after returning from the
+ * handler. */
+ kill(getpid(), signum);
+}
+
+static void
+register_signal_handler(int signum)
+{
+ struct sigaction act;
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = signal_handler;
+ act.sa_mask = fatal_signal_set;
+ act.sa_flags = SA_RESTART;
+ sigaction(signum, &act, NULL);
+}
+
+static void
+set_up_signal_handlers(void)
+{
+ sigemptyset(&fatal_signal_set);
+ sigaddset(&fatal_signal_set, SIGINT);
+ sigaddset(&fatal_signal_set, SIGTERM);
+#ifdef SIGHUP
+ sigaddset(&fatal_signal_set, SIGHUP);
+#endif
+#ifdef SIGQUIT
+ sigaddset(&fatal_signal_set, SIGQUIT);
+#endif
+
+ register_signal_handler(SIGINT);
+ register_signal_handler(SIGTERM);
+#ifdef SIGHUP
+ register_signal_handler(SIGHUP);
+#endif
+#ifdef SIGQUIT
+ register_signal_handler(SIGQUIT);
+#endif
}
static void
x_unlink(dest);
ret = link(source, dest);
} else {
- ret = copy_file(source, dest, conf->compression);
+ ret = copy_file(
+ source, dest, conf->compression ? conf->compression_level : 0);
}
if (ret != 0) {
cc_log("Failed to %s %s to %s: %s",
}
cc_log("Running real compiler");
- status = execute(args->argv, tmp_stdout_fd, tmp_stderr_fd);
+ status = execute(args->argv, tmp_stdout_fd, tmp_stderr_fd, &compiler_pid);
args_pop(args, 3);
if (x_stat(tmp_stdout, &st) != 0) {
args_add(args, "-E");
args_add(args, input_file);
cc_log("Running preprocessor");
- status = execute(args->argv, path_stdout_fd, path_stderr_fd);
+ status = execute(args->argv, path_stdout_fd, path_stderr_fd, &compiler_pid);
args_pop(args, 2);
}
compiler_is_clang(struct args *args)
{
char *name = basename(args->argv[0]);
- bool is = strstr(name, "clang");
+ bool is = strstr(name, "clang") != NULL;
free(name);
return is;
}
/* Arguments to send to the real compiler. */
struct args *compiler_args;
+ set_up_signal_handlers();
+
orig_args = args_init(argc, argv);
initialize();
find_compiler(argv);
-#ifndef _WIN32
- signal(SIGHUP, signal_handler);
-#endif
- signal(SIGINT, signal_handler);
- signal(SIGTERM, signal_handler);
-
if (str_eq(conf->temporary_dir, "")) {
clean_up_internal_tempdir();
}
void stats_update_size(uint64_t size, unsigned files);
void stats_get_obsolete_limits(const char *dir, unsigned *maxfiles,
uint64_t *maxsize);
-void stats_set_sizes(const char *dir, size_t num_files, size_t total_size);
+void stats_set_sizes(const char *dir, unsigned num_files, uint64_t total_size);
void stats_read(const char *path, struct counters *counters);
void stats_write(const char *path, struct counters *counters);
/* ------------------------------------------------------------------------- */
/* execute.c */
-int execute(char **argv, int fd_out, int fd_err);
+int execute(char **argv, int fd_out, int fd_err, pid_t *pid);
char *find_executable(const char *name, const char *exclude_name);
void print_command(FILE *fp, char **argv);
/* ccache.c */
extern time_t time_of_compilation;
+void block_signals(void);
+void unblock_signals(void);
bool cc_process_args(struct args *args, struct args **preprocessor_args,
struct args **compiler_args);
void cc_reset(void);
char **value = (char **)result;
free(*value);
*value = subst_env_in_string(str, errmsg);
- return *value;
+ return *value != NULL;
}
static bool
test_suites
include_dev_mk
extra_libs
-extra_ldflags
-extra_cppflags
host_os
host_vendor
host_cpu
case $host in
- *mingw32* | *cygwin* | *wince* | *mingwce*)
+ *mingw32* | *mingw64* | *cygwin* | *wince* | *mingwce*)
windows_os=yes
$as_echo "#define _WIN32_WINNT 0x0600" >>confdefs.h
-
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
fi
if test x${use_bundled_zlib} = xyes; then
- extra_cppflags="-I\$(srcdir)/zlib"
- extra_ldflags="-Lzlib"
+ CPPFLAGS="$CPPFLAGS -I\$(srcdir)/zlib"
extra_libs="zlib/libz.a"
mkdir -p zlib
else
- extra_libs="-lz"
+ LIBS="$LIBS -lz"
fi
if test x${windows_os} = xyes; then
- extra_ldflags="$extra_ldflags -lws2_32"
+ LIBS="$LIBS -lws2_32"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
AC_CANONICAL_HOST
case $host in
- *mingw32* | *cygwin* | *wince* | *mingwce*)
+ *mingw32* | *mingw64* | *cygwin* | *wince* | *mingwce*)
windows_os=yes
AC_DEFINE(_WIN32_WINNT,0x0600, Windows Vista or newer is required)
;;
esac
-AC_SUBST(extra_cppflags)
-AC_SUBST(extra_ldflags)
AC_SUBST(extra_libs)
AC_SUBST(include_dev_mk)
AC_SUBST(test_suites)
fi
if test x${use_bundled_zlib} = xyes; then
- extra_cppflags="-I\$(srcdir)/zlib"
- extra_ldflags="-Lzlib"
+ CPPFLAGS="$CPPFLAGS -I\$(srcdir)/zlib"
extra_libs="zlib/libz.a"
mkdir -p zlib
else
- extra_libs="-lz"
+ LIBS="$LIBS -lz"
fi
dnl Linking on Windows needs ws2_32
if test x${windows_os} = xyes; then
- extra_ldflags="$extra_ldflags -lws2_32"
+ LIBS="$LIBS -lws2_32"
fi
AC_C_BIGENDIAN
/* Execute a compiler backend, capturing all output to the given paths the full
* path to the compiler to run is in argv[0]. */
int
-execute(char **argv, int fd_out, int fd_err)
+execute(char **argv, int fd_out, int fd_err, pid_t *pid)
{
- pid_t pid;
int status;
cc_log_argv("Executing ", argv);
- pid = fork();
- if (pid == -1) {
+
+ block_signals();
+ *pid = fork();
+ unblock_signals();
+
+ if (*pid == -1) {
fatal("Failed to fork: %s", strerror(errno));
}
- if (pid == 0) {
+ if (*pid == 0) {
/* Child. */
dup2(fd_out, 1);
close(fd_out);
close(fd_out);
close(fd_err);
- if (waitpid(pid, &status, 0) != pid) {
+ if (waitpid(*pid, &status, 0) != *pid) {
fatal("waitpid failed: %s", strerror(errno));
}
+ block_signals();
+ *pid = 0;
+ unblock_signals();
+
if (WEXITSTATUS(status) == 0 && WIFSIGNALED(status)) {
return -1;
}
bool
language_is_supported(const char *language)
{
- return p_language_for_language(language);
+ return p_language_for_language(language) != NULL;
}
bool
/* set the per directory sizes */
void
-stats_set_sizes(const char *dir, size_t num_files, size_t total_size)
+stats_set_sizes(const char *dir, unsigned num_files, uint64_t total_size)
{
struct counters *counters = counters_init(STATS_END);
char *statsfile;
/*
- * Copyright (C) 2010-2014 Joel Rosdahl
+ * Copyright (C) 2010-2015 Joel Rosdahl
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <time.h>
#include <unistd.h>
#include <utime.h>
/*
- * Copyright (C) 2010-2013 Joel Rosdahl
+ * Copyright (C) 2010-2015 Joel Rosdahl
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
orig = args_init_from_string(arg_string);
CHECK(cc_process_args(orig, &act_cpp, &act_cc));
- CHECK(str_startswith(act_cpp->argv[1], "--sysroot=./foo"));
+ CHECK_STR_EQ(act_cpp->argv[1], "--sysroot=./foo");
args_free(orig);
args_free(act_cpp);
args_free(orig);
}
-TEST(fprofile_flag_with_nonexisting_dir_not_be_rewritten)
+TEST(fprofile_flag_with_nonexisting_dir_should_not_be_rewritten)
{
struct args *orig = args_init_from_string(
"gcc -c -fprofile-generate=some/dir foo.c");
TEST(get_relative_path)
{
+#ifdef _WIN32
+ CHECK_STR_EQ_FREE2("a", get_relative_path("C:/doesn't matter", "a"));
+ CHECK_STR_EQ_FREE2("a/b", get_relative_path("C:/doesn't matter", "a/b"));
+ CHECK_STR_EQ_FREE2(".", get_relative_path("C:/a", "C:/a"));
+ CHECK_STR_EQ_FREE2("..", get_relative_path("C:/a/b", "C:/a"));
+ CHECK_STR_EQ_FREE2("b", get_relative_path("C:/a", "C:/a/b"));
+ CHECK_STR_EQ_FREE2("b/c", get_relative_path("C:/a", "C:/a/b/c"));
+ CHECK_STR_EQ_FREE2("../c", get_relative_path("C:/a/b", "C:/a/c"));
+ CHECK_STR_EQ_FREE2("../c/d", get_relative_path("C:/a/b", "C:/a/c/d"));
+ CHECK_STR_EQ_FREE2("../../c/d", get_relative_path("C:/a/b/c", "C:/a/c/d"));
+ CHECK_STR_EQ_FREE2("../..", get_relative_path("C:/a/b", "C:/"));
+ CHECK_STR_EQ_FREE2("../../c", get_relative_path("C:/a/b", "C:/c"));
+ CHECK_STR_EQ_FREE2("a/b", get_relative_path("C:/", "C:/a/b"));
+#else
CHECK_STR_EQ_FREE2("a", get_relative_path("/doesn't matter", "a"));
CHECK_STR_EQ_FREE2("a/b", get_relative_path("/doesn't matter", "a/b"));
CHECK_STR_EQ_FREE2(".", get_relative_path("/a", "/a"));
CHECK_STR_EQ_FREE2("../..", get_relative_path("/a/b", "/"));
CHECK_STR_EQ_FREE2("../../c", get_relative_path("/a/b", "/c"));
CHECK_STR_EQ_FREE2("a/b", get_relative_path("/", "/a/b"));
+#endif
}
TEST(format_hash_as_string)
const char *p;
char *result;
- assert(from && from[0] == '/');
+ assert(from && is_absolute_path(from));
assert(to);
- if (!*to || *to != '/') {
+ if (!*to || !is_absolute_path(to)) {
return x_strdup(to);
}
+#ifdef _WIN32
+ // Both paths are absolute, drop the drive letters
+ assert(from[0] == to[0]); // Assume the same drive letter
+ from += 2;
+ to += 2;
+#endif
+
result = x_strdup("");
common_prefix_len = common_dir_prefix_length(from, to);
if (common_prefix_len > 0 || !str_eq(from, "/")) {
if (curly) {
if (*q != '}') {
*errmsg = format("syntax error: missing '}' after \"%s\"", p);
- return NULL;
+ return false;
}
}
-const char CCACHE_VERSION[] = "3.2.3";
+const char CCACHE_VERSION[] = "3.2.4";