linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ibsim/ibsim.c: Fixed bug regarding undefined commands
@ 2012-05-31 22:04 Huang, Parry W.
       [not found] ` <25EBDF7A-17DB-41FC-9CC8-7F960B6CA304-i2BcT+NCU+M@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Huang, Parry W. @ 2012-05-31 22:04 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

In sim_cmd_file and sim_run_console, fixed bug regarding a new line being kept at the end of the input when an unknown command is processed from console or from file.

Signed-off-by: Perry Huang <huang32-i2BcT+NCU+M@public.gmane.org>
---
 ibsim/ibsim.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ibsim/ibsim.c b/ibsim/ibsim.c
index e720f0d..d894913 100644
--- a/ibsim/ibsim.c
+++ b/ibsim/ibsim.c
@@ -546,6 +546,8 @@ int sim_cmd_file(FILE * f, char *s)
 	}
 
 	while (fgets(line, sizeof(line) - 1, cmd_file) != NULL) {
+		if((p = strchr(line, '\n')) != NULL)
+			*p = '\0';
 		do_cmd(line, f);
 	}
 
@@ -588,11 +590,14 @@ static int sim_run_console(int fd)
 {
 	char line[128];
 	int ret = 0;
+	char *p = NULL;
 
 	ret = readline(fd, line, sizeof(line) - 1);
 	if (ret <= 0)
 		return ret;
 
+	if((p = strchr(line, '\n')) != NULL)
+		*p = '\0';
 	do_cmd(line, simout);
 	fprintf(simout, "sim%s> ", netstarted ? "" : " (inactive)");
 	fflush(simout);
-- 
1.7.1--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] ibsim/ibsim.c: Fixed bug regarding undefined commands
       [not found] ` <25EBDF7A-17DB-41FC-9CC8-7F960B6CA304-i2BcT+NCU+M@public.gmane.org>
@ 2012-10-11 12:45   ` Alex Netes
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Netes @ 2012-10-11 12:45 UTC (permalink / raw)
  To: Huang, Parry W.; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Hi Parry,

On 15:04 Thu 31 May     , Huang, Parry W. wrote:
> In sim_cmd_file and sim_run_console, fixed bug regarding a new line being kept at the end of the input when an unknown command is processed from console or from file.
> 
> Signed-off-by: Perry Huang <huang32-i2BcT+NCU+M@public.gmane.org>
> ---

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-11 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 22:04 [PATCH 1/2] ibsim/ibsim.c: Fixed bug regarding undefined commands Huang, Parry W.
     [not found] ` <25EBDF7A-17DB-41FC-9CC8-7F960B6CA304-i2BcT+NCU+M@public.gmane.org>
2012-10-11 12:45   ` Alex Netes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).