Deleted Added
full compact
str.c (97104) str.c (97123)
1/*-
2 * Copyright (c) 1988, 1989, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1989 by Berkeley Softworks
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.

--- 25 unchanged lines hidden (view full) ---

34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)str.c 5.8 (Berkeley) 6/1/90
39 */
40
41#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1988, 1989, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1989 by Berkeley Softworks
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.

--- 25 unchanged lines hidden (view full) ---

34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)str.c 5.8 (Berkeley) 6/1/90
39 */
40
41#include <sys/cdefs.h>
42__FBSDID("$FreeBSD: head/usr.bin/make/str.c 97104 2002-05-22 11:16:48Z jmallett $");
42__FBSDID("$FreeBSD: head/usr.bin/make/str.c 97123 2002-05-22 15:34:00Z jmallett $");
43
44#include "make.h"
45
46static char **argv, *buffer;
47static int argmax, curlen;
48
49/*
50 * str_init --

--- 31 unchanged lines hidden (view full) ---

82 * concatenate the two strings, inserting a space or slash between them,
83 * freeing them if requested.
84 *
85 * returns --
86 * the resulting string in allocated space.
87 */
88char *
89str_concat(s1, s2, flags)
43
44#include "make.h"
45
46static char **argv, *buffer;
47static int argmax, curlen;
48
49/*
50 * str_init --

--- 31 unchanged lines hidden (view full) ---

82 * concatenate the two strings, inserting a space or slash between them,
83 * freeing them if requested.
84 *
85 * returns --
86 * the resulting string in allocated space.
87 */
88char *
89str_concat(s1, s2, flags)
90 const char *s1, *s2;
90 char *s1, *s2;
91 int flags;
92{
93 int len1, len2;
94 char *result;
95
96 /* get the length of both strings */
97 len1 = strlen(s1);
98 len2 = strlen(s2);

--- 13 unchanged lines hidden (view full) ---

112 ++len1;
113 }
114
115 /* copy second string plus EOS into place */
116 memcpy(result + len1, s2, len2 + 1);
117
118 /* free original strings */
119 if (flags & STR_DOFREE) {
91 int flags;
92{
93 int len1, len2;
94 char *result;
95
96 /* get the length of both strings */
97 len1 = strlen(s1);
98 len2 = strlen(s2);

--- 13 unchanged lines hidden (view full) ---

112 ++len1;
113 }
114
115 /* copy second string plus EOS into place */
116 memcpy(result + len1, s2, len2 + 1);
117
118 /* free original strings */
119 if (flags & STR_DOFREE) {
120 (void)efree((void *)s1);
121 (void)efree((void *)s2);
120 (void)efree(s1);
121 (void)efree(s2);
122 }
123 return(result);
124}
125
126/*-
127 * brk_string --
128 * Fracture a string into an array of words (as delineated by tabs or
129 * spaces) taking quotation marks into account. Leading tabs/spaces

--- 368 unchanged lines hidden ---
122 }
123 return(result);
124}
125
126/*-
127 * brk_string --
128 * Fracture a string into an array of words (as delineated by tabs or
129 * spaces) taking quotation marks into account. Leading tabs/spaces

--- 368 unchanged lines hidden ---