Re: [PATCH 2/7] system_path(): Add prefix computation at runtime if RUNTIME_PREFIX set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Aug 17, 2008, at 10:43 PM, Johannes Sixt wrote:

On Sonntag, 17. August 2008, Steffen Prohaska wrote:

diff --git a/exec_cmd.c b/exec_cmd.c
index ce6741e..1622481 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -9,11 +9,51 @@ static const char *argv0_path;

const char *system_path(const char *path)
{
-	if (!is_absolute_path(path) && argv0_path) {
-		struct strbuf d = STRBUF_INIT;
-		strbuf_addf(&d, "%s/%s", argv0_path, path);
-		path = strbuf_detach(&d, NULL);
+#ifdef RUNTIME_PREFIX
+	static const char *prefix;
+
+	if (!argv0_path) {
+		fprintf(stderr, "RUNTIME_PREFIX requested for path '%s', "
+				"but argv0_path not set.\n", path);

If this happens, isn't this a logic error: assert(argv0_path)?

We could consider this a logic error.


	}
+
+	if (!prefix) {
+		fprintf(stderr, "RUNTIME_PREFIX requested for path '%s', "
+				"but prefix computation failed.\n", path);

Again a logic error?

The user can move the executable, so it's not a logic error.

	Steffen
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux