openbsd-ports/misc/mshell/patches/patch-string_c

33 lines
808 B
Plaintext

$OpenBSD: patch-string_c,v 1.3 2009/03/26 18:25:28 naddy Exp $
--- string.c.orig Thu Mar 26 12:17:56 2009
+++ string.c Thu Mar 26 12:18:04 2009
@@ -4,7 +4,20 @@
#define strchr index
#endif
+char *strsave(char *);
+char *
+gets (char *s)
+{
+ char *x = fgets (s, WORDLEN, stdin);
+ if (x) {
+ char *p = strchr (x, '\n');
+ if (p)
+ *p = 0;
+ }
+ return x;
+}
+
/* function to find the position of sub_string in main_string
* ---------------------------------------------------------- */
@@ -260,7 +273,6 @@ char *string;
/* if it has a multi-command delim, save rest for next time */
#define MULTI_CMD_DELIM ','
if (p = index(string, MULTI_CMD_DELIM)) {
- char *strsave();
struct inp_link *l;
*p++ = EOS;
if ((l=getnode(sizeof(*l))) && (l->input=strsave(p)))