Deleted Added
full compact
libmap.c (115150) libmap.c (115396)
1/*
1/*
2 * $FreeBSD: head/libexec/rtld-elf/libmap.c 115150 2003-05-19 07:10:12Z mdodd $
2 * $FreeBSD: head/libexec/rtld-elf/libmap.c 115396 2003-05-29 22:58:26Z kan $
3 */
4
5#include <stdio.h>
6#include <ctype.h>
7#include <string.h>
8#include <stdlib.h>
9#include <sys/queue.h>
10#include <sys/param.h>

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

86 /* Check if there is a closing brace */
87 if (*cp != ']') continue;
88
89 /* Terminate string if there was no trailing space */
90 *cp++ = '\0';
91
92 /*
93 * There should be nothing except whitespace or comment
3 */
4
5#include <stdio.h>
6#include <ctype.h>
7#include <string.h>
8#include <stdlib.h>
9#include <sys/queue.h>
10#include <sys/param.h>

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

86 /* Check if there is a closing brace */
87 if (*cp != ']') continue;
88
89 /* Terminate string if there was no trailing space */
90 *cp++ = '\0';
91
92 /*
93 * There should be nothing except whitespace or comment
94 * from this point to the end of the line.
94 from this point to the end of the line.
95 */
96 while(isspace(*cp++));
97 if (!iseol(*cp)) continue;
98
99 strcpy(prog, p);
100 p = prog;
101 continue;
102 }

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

109 while (isspace(*cp)) *cp++ = '\0';
110
111 /* Found a comment or EOL */
112 if (iseol(*cp)) continue;
113
114 /* Parse 'to' mapping */
115 t = cp++;
116 while (!isspace(*cp) && !iseol(*cp)) cp++;
95 */
96 while(isspace(*cp++));
97 if (!iseol(*cp)) continue;
98
99 strcpy(prog, p);
100 p = prog;
101 continue;
102 }

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

109 while (isspace(*cp)) *cp++ = '\0';
110
111 /* Found a comment or EOL */
112 if (iseol(*cp)) continue;
113
114 /* Parse 'to' mapping */
115 t = cp++;
116 while (!isspace(*cp) && !iseol(*cp)) cp++;
117
117
118 /* Skip and zero out the trailing whitespace */
119 while (isspace(*cp)) *cp++ = '\0';
120
121 /* Should be no extra tokens at this point */
122 if (!iseol(*cp)) continue;
123
124 *cp = '\0';
125 lm_add(p, xstrdup(f), xstrdup(t));

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

162lm_add (char *p, char *f, char *t)
163{
164 struct lm_list *lml;
165 struct lm *lm;
166
167 if (p == NULL)
168 p = "$DEFAULT$";
169
118 /* Skip and zero out the trailing whitespace */
119 while (isspace(*cp)) *cp++ = '\0';
120
121 /* Should be no extra tokens at this point */
122 if (!iseol(*cp)) continue;
123
124 *cp = '\0';
125 lm_add(p, xstrdup(f), xstrdup(t));

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

162lm_add (char *p, char *f, char *t)
163{
164 struct lm_list *lml;
165 struct lm *lm;
166
167 if (p == NULL)
168 p = "$DEFAULT$";
169
170#if 0
171 printf("%s(\"%s\", \"%s\", \"%s\")\n", __func__, p, f, t);
172#endif
173
174 if ((lml = lmp_find(p)) == NULL)
175 lml = lmp_init(xstrdup(p));
176
177 lm = xmalloc(sizeof(struct lm));
178 lm->f = f;
179 lm->t = t;
180 TAILQ_INSERT_HEAD(lml, lm, lm_link);
181}

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

235
236 lmp = xmalloc(sizeof(struct lmp));
237 lmp->p = n;
238 TAILQ_INIT(&lmp->lml);
239 TAILQ_INSERT_HEAD(&lmp_head, lmp, lmp_link);
240
241 return (&lmp->lml);
242}
170 if ((lml = lmp_find(p)) == NULL)
171 lml = lmp_init(xstrdup(p));
172
173 lm = xmalloc(sizeof(struct lm));
174 lm->f = f;
175 lm->t = t;
176 TAILQ_INSERT_HEAD(lml, lm, lm_link);
177}

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

231
232 lmp = xmalloc(sizeof(struct lmp));
233 lmp->p = n;
234 TAILQ_INIT(&lmp->lml);
235 TAILQ_INSERT_HEAD(&lmp_head, lmp, lmp_link);
236
237 return (&lmp->lml);
238}
239