From nobody Wed Dec 17 21:46:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557493762; cv=none; d=zoho.com; s=zohoarc; b=YhJd9sfHn9rIThzpgmdgMEf3qztjV6uVRkSPfisB0HbKbMzE2SbEjp/bRF1kBtKst82MyFtySzDTOsK9XHt9JrdlVr4hyuGWrGQ/YmiTjWJKaCuGvlcz7QCXbDG91nP8HFVhlfJr5DNUpFP9oCFYFB7kx4S0qOq20LBL+gGAVfw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557493762; h=Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=aMMIcdS42PICbaU3DyfikwaX1ACLCNqvz+zmy8pQ9MU=; b=hWpbDyi82W9oAiSvSTTSuw5lNGdM1paZgRD8WGqP/3aE6v3TwtftBoWs2CVa0bkAOoTCNdSnfz5SpG1owJellUHycXMEJzWcwh3oP0RDia/uO0BeuERTb8A1wtgSj6nj0y5b2+VizMnBJnU3jlwgwgc51OpyceKizxzP8yBU49s= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557493762409596.0580845957354; Fri, 10 May 2019 06:09:22 -0700 (PDT) Received: from localhost ([127.0.0.1]:43033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP5H2-0001A1-AF for importer@patchew.org; Fri, 10 May 2019 09:09:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP5Av-0004MD-NW for qemu-devel@nongnu.org; Fri, 10 May 2019 09:02:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hP5Au-0004AH-Ht for qemu-devel@nongnu.org; Fri, 10 May 2019 09:02:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56062) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hP5Ar-00044l-SB; Fri, 10 May 2019 09:02:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 26C8B821EF; Fri, 10 May 2019 13:02:53 +0000 (UTC) Received: from localhost (ovpn-116-89.ams2.redhat.com [10.36.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADFF21001E86; Fri, 10 May 2019 13:02:52 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Date: Fri, 10 May 2019 14:02:37 +0100 Message-Id: <20190510130243.8887-3-stefanha@redhat.com> In-Reply-To: <20190510130243.8887-1-stefanha@redhat.com> References: <20190510130243.8887-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 10 May 2019 13:02:53 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/8] util: readline: replace tab indent by four spaces to fix checkpatch errors X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Peter Maydell , Jules Irenge , qemu-block@nongnu.org, Thomas Huth , Max Reitz , Stefan Hajnoczi , Paolo Bonzini , Kevin Wolf Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Jules Irenge Replace tab indent by four spaces to fix errors issued by checkpatch.pl tool "ERROR: code indent should never use tabs" within "util/readline.c" file. Signed-off-by: Jules Irenge Reviewed-by: Thomas Huth Message-id: 20190401024406.10819-3-jbi.octave@gmail.com Message-Id: <20190401024406.10819-3-jbi.octave@gmail.com> Signed-off-by: Stefan Hajnoczi --- util/readline.c | 98 ++++++++++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/util/readline.c b/util/readline.c index db399d3948..3eb5a66dfc 100644 --- a/util/readline.c +++ b/util/readline.c @@ -179,20 +179,20 @@ static void readline_up_char(ReadLineState *rs) int idx; =20 if (rs->hist_entry =3D=3D 0) - return; + return; if (rs->hist_entry =3D=3D -1) { - /* Find latest entry */ - for (idx =3D 0; idx < READLINE_MAX_CMDS; idx++) { - if (rs->history[idx] =3D=3D NULL) - break; - } - rs->hist_entry =3D idx; + /* Find latest entry */ + for (idx =3D 0; idx < READLINE_MAX_CMDS; idx++) { + if (rs->history[idx] =3D=3D NULL) + break; + } + rs->hist_entry =3D idx; } rs->hist_entry--; if (rs->hist_entry >=3D 0) { - pstrcpy(rs->cmd_buf, sizeof(rs->cmd_buf), + pstrcpy(rs->cmd_buf, sizeof(rs->cmd_buf), rs->history[rs->hist_entry]); - rs->cmd_buf_index =3D rs->cmd_buf_size =3D strlen(rs->cmd_buf); + rs->cmd_buf_index =3D rs->cmd_buf_size =3D strlen(rs->cmd_buf); } } =20 @@ -202,11 +202,11 @@ static void readline_down_char(ReadLineState *rs) return; if (rs->hist_entry < READLINE_MAX_CMDS - 1 && rs->history[++rs->hist_entry] !=3D NULL) { - pstrcpy(rs->cmd_buf, sizeof(rs->cmd_buf), + pstrcpy(rs->cmd_buf, sizeof(rs->cmd_buf), rs->history[rs->hist_entry]); } else { rs->cmd_buf[0] =3D 0; - rs->hist_entry =3D -1; + rs->hist_entry =3D -1; } rs->cmd_buf_index =3D rs->cmd_buf_size =3D strlen(rs->cmd_buf); } @@ -217,42 +217,42 @@ static void readline_hist_add(ReadLineState *rs, cons= t char *cmdline) int idx; =20 if (cmdline[0] =3D=3D '\0') - return; + return; new_entry =3D NULL; if (rs->hist_entry !=3D -1) { - /* We were editing an existing history entry: replace it */ - hist_entry =3D rs->history[rs->hist_entry]; - idx =3D rs->hist_entry; - if (strcmp(hist_entry, cmdline) =3D=3D 0) { - goto same_entry; - } + /* We were editing an existing history entry: replace it */ + hist_entry =3D rs->history[rs->hist_entry]; + idx =3D rs->hist_entry; + if (strcmp(hist_entry, cmdline) =3D=3D 0) { + goto same_entry; + } } /* Search cmdline in history buffers */ for (idx =3D 0; idx < READLINE_MAX_CMDS; idx++) { - hist_entry =3D rs->history[idx]; - if (hist_entry =3D=3D NULL) - break; - if (strcmp(hist_entry, cmdline) =3D=3D 0) { - same_entry: - new_entry =3D hist_entry; - /* Put this entry at the end of history */ - memmove(&rs->history[idx], &rs->history[idx + 1], - (READLINE_MAX_CMDS - (idx + 1)) * sizeof(char *)); - rs->history[READLINE_MAX_CMDS - 1] =3D NULL; - for (; idx < READLINE_MAX_CMDS; idx++) { - if (rs->history[idx] =3D=3D NULL) - break; - } - break; - } + hist_entry =3D rs->history[idx]; + if (hist_entry =3D=3D NULL) + break; + if (strcmp(hist_entry, cmdline) =3D=3D 0) { + same_entry: + new_entry =3D hist_entry; + /* Put this entry at the end of history */ + memmove(&rs->history[idx], &rs->history[idx + 1], + (READLINE_MAX_CMDS - (idx + 1)) * sizeof(char *)); + rs->history[READLINE_MAX_CMDS - 1] =3D NULL; + for (; idx < READLINE_MAX_CMDS; idx++) { + if (rs->history[idx] =3D=3D NULL) + break; + } + break; + } } if (idx =3D=3D READLINE_MAX_CMDS) { - /* Need to get one free slot */ + /* Need to get one free slot */ g_free(rs->history[0]); - memmove(rs->history, &rs->history[1], - (READLINE_MAX_CMDS - 1) * sizeof(char *)); - rs->history[READLINE_MAX_CMDS - 1] =3D NULL; - idx =3D READLINE_MAX_CMDS - 1; + memmove(rs->history, &rs->history[1], + (READLINE_MAX_CMDS - 1) * sizeof(char *)); + rs->history[READLINE_MAX_CMDS - 1] =3D NULL; + idx =3D READLINE_MAX_CMDS - 1; } if (new_entry =3D=3D NULL) new_entry =3D g_strdup(cmdline); @@ -403,9 +403,9 @@ void readline_handle_byte(ReadLineState *rs, int ch) case 8: readline_backspace(rs); break; - case 155: + case 155: rs->esc_state =3D IS_CSI; - break; + break; default: if (ch >=3D 32) { readline_insert_char(rs, ch); @@ -426,14 +426,14 @@ void readline_handle_byte(ReadLineState *rs, int ch) break; case IS_CSI: switch (ch) { - case 'A': - case 'F': - readline_up_char(rs); - break; - case 'B': - case 'E': - readline_down_char(rs); - break; + case 'A': + case 'F': + readline_up_char(rs); + break; + case 'B': + case 'E': + readline_down_char(rs); + break; case 'D': readline_backward_char(rs); break; --=20 2.21.0