From nobody Mon Feb 9 07:23:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1698037028; cv=none; d=zohomail.com; s=zohoarc; b=RYgmFm9QW9u7YDb3neLU8Y8GW9uwwMz6ooqWBtwav0B9mDYnVMhwp2X9vMg95/JOe9029N4jWOLxmcLV74NFAwUV57LtzTuZJFRSktlJeK4j1ak9RBTe7ZscRc3cdG+3BhMuXQit7Vytd07snTh2cAURh+S7o/jekGoVr2SHjZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698037028; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cKfI/taawNhVk/GlXnNQ6RGBMA/BaGjS8Act5q/Ic+I=; b=I8B4pVNybsn5P5UWeslY3OGJebIRgROm7zT9arjtkFuwDccNCdPdqfITpoazr91HkBIiNS1pY0AfelvyTwXcmV9+8Z08YV4lcrw4AdieGciUSqY+VIpwXBtP4vffuiUvrf72MKOQOQ+wBKD96k36UV04nynVxk0bjkaUip270Zk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1698037028040720.8953000288806; Sun, 22 Oct 2023 21:57:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-249-1M7ZTjuEMhKLq_bI9r63xA-1; Mon, 23 Oct 2023 00:55:09 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 600191C0754D; Mon, 23 Oct 2023 04:54:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4699D1C060AE; Mon, 23 Oct 2023 04:54:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4C20A19452F0; Mon, 23 Oct 2023 04:54:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BDA691946587 for ; Mon, 23 Oct 2023 04:54:55 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AF509C1597E; Mon, 23 Oct 2023 04:54:55 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.8.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7530CC1596D; Mon, 23 Oct 2023 04:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698037027; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=cKfI/taawNhVk/GlXnNQ6RGBMA/BaGjS8Act5q/Ic+I=; b=adypQhZkENMMnWDSw25JjQnWR6WHbkXrpKN3r8Mnne2jDdd5FMyZ8VlfNKG1Ex3i8lL6Tn cAfbApJsiOLUJDWA+wTQ2kbrIzSL7nW+zoOhaYrVvP/nm7BCm5A3PaRMK5wTRadN6eBrHa ORbhWL2KUcoItojF4dKl4yEBP/eHUS8= X-MC-Unique: 1M7ZTjuEMhKLq_bI9r63xA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 13/15] util: new function virStringSkipToSpace() Date: Mon, 23 Oct 2023 00:54:49 -0400 Message-ID: <20231023045451.210711-14-laine@redhat.com> In-Reply-To: <20231023045451.210711-1-laine@redhat.com> References: <20231023045451.210711-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joao Martins , Cedric Le Goater , Jason Gunthorpe Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1698037029895100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Add a surprisingly missing simple function to the arsenal. Signed-off-by: Laine Stump --- src/libvirt_private.syms | 1 + src/util/virstring.c | 17 +++++++++++++++++ src/util/virstring.h | 1 + 3 files changed, 19 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index a943a79e01..3e8eded81e 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3409,6 +3409,7 @@ virSkipSpaces; virSkipSpacesAndBackslash; virSkipSpacesBackwards; virSkipToDigit; +virSkipToSpace; virStrcpy; virStringBufferIsPrintable; virStringFilterChars; diff --git a/src/util/virstring.c b/src/util/virstring.c index 6b728ff047..4a732de5dc 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -441,6 +441,23 @@ virSkipToDigit(const char **str) } =20 =20 +/** + * virSkipToSApace: + * @str: pointer to the char pointer used + * + * Skip over any character that is not whitespace + */ +void +virSkipToSpace(const char **str) +{ + const char *cur =3D *str; + + while (*cur && !g_ascii_isspace(*cur)) + cur++; + *str =3D cur; +} + + /** * virTrimSpaces: * @str: string to modify to remove all trailing spaces diff --git a/src/util/virstring.h b/src/util/virstring.h index 16dcce98f4..9fd8be44cf 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -74,6 +74,7 @@ int virDoubleToStr(char **strp, double number) void virSkipSpaces(const char **str) ATTRIBUTE_NONNULL(1); void virSkipSpacesAndBackslash(const char **str) ATTRIBUTE_NONNULL(1); void virSkipToDigit(const char **str) ATTRIBUTE_NONNULL(1); +void virSkipToSpace(const char **str) ATTRIBUTE_NONNULL(1); void virTrimSpaces(char *str, char **endp) ATTRIBUTE_NONNULL(1); void virSkipSpacesBackwards(const char *str, char **endp) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); --=20 2.41.0