From nobody Wed Dec 17 09:18:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614768367; cv=none; d=zohomail.com; s=zohoarc; b=A7s3DcqOnR7T90mzJ/fH1thEReJlHu1cxVH7buGCgIQqrSG4c9LLIALUlPsie9ZMsjBJbrDv2QaFVKhXQUxGE6lTITMq+pqC+8BTGRIBTSY3n3MKQ98/f0Qc2Easzaqz+YSxsNPrSvs5mtsO3avbbNaaiZVIqjKtNCdUgRQiXHk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614768367; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A2nc4pFR9cvpParhrQFMpvf26szxEPZell7uRnivhrs=; b=IvnJQomr8mcvdSE5gekkGPHpKPEXODXhUyCPT7/Nl5QhBpdEts72D0GYhdh+S3LyWxaOp7LV38AUaTAmFfaul7KZwVNRhbXoFdQ1TRNV0qS1Jxdg3OhsONCV3PbxUAm/sy6ZNgHNNEeKsKh3s9DELdhOwBzwL6rujKnK7/odJNM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1614768367826987.4188787277818; Wed, 3 Mar 2021 02:46:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-571-oomKGSDQPe-gkYuTcsV1bA-1; Wed, 03 Mar 2021 05:46:04 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DD135DBC0; Wed, 3 Mar 2021 10:45:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BCAF46F45E; Wed, 3 Mar 2021 10:45:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 868ED5807E; Wed, 3 Mar 2021 10:45:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 123AjlRO027969 for ; Wed, 3 Mar 2021 05:45:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 81BC55D74B; Wed, 3 Mar 2021 10:45:47 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFD0B62A03 for ; Wed, 3 Mar 2021 10:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614768366; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=A2nc4pFR9cvpParhrQFMpvf26szxEPZell7uRnivhrs=; b=bngmhjYXzfqUX4WXKMbQUYj1brDfVBdrUcGshw+x2hqgFbGSSxkv7cTJcxamTqj6a3heHP vfh6ss6o4GWFmudUvYaVz8xTn9IjWZqmEmJCv6XlHrQa6BHcNoVfRjFvwIYhpOSikn3iA9 gi4F77IE7zDXPvKCMqZqLdRVVO12QcQ= X-MC-Unique: oomKGSDQPe-gkYuTcsV1bA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/5] commandhelper: printCwd: Print result directly instead of copying it Date: Wed, 3 Mar 2021 11:45:37 +0100 Message-Id: <27844d021b07670aa056190b2cd82076c300a0b0.1614768104.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa --- tests/commandhelper.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index ee06339392..9b56feb120 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -221,9 +221,10 @@ static int printCwd(FILE *log) if (!(cwd =3D getcwd(NULL, 0))) return -1; - if ((strlen(cwd) > strlen(".../commanddata")) && - (STREQ(cwd + strlen(cwd) - strlen("/commanddata"), "/commanddata")= )) { - strcpy(cwd, ".../commanddata"); + if ((display =3D strstr(cwd, "/commanddata")) && + STREQ(display, "/commanddata")) { + fprintf(log, "CWD:.../commanddata\n"); + return 0; } display =3D cwd; --=20 2.29.2