summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2002-06-06 06:10:17 -0500
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2002-06-06 06:10:17 -0500
commitb28ae717120f4d9726905d0d3ef7d8e9a1c72fd0 (patch)
treeb4029f4610eeb688505f9f238c2da4e13f1201d4 /scripts
parentf85cd0e83fcf47a069f22a5e0f0c8538cff8eaf7 (diff)
kbuild: dependency generation fixes
o Fix a bug in fixdep.c, which could cause segfaults o Make sure that we build fixdep first of all, since we need it to build host programs.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile12
-rw-r--r--scripts/fixdep.c11
2 files changed, 17 insertions, 6 deletions
diff --git a/scripts/Makefile b/scripts/Makefile
index 11509a5bfd74..51dc632e2829 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -44,8 +44,20 @@ doc-progs: docproc
# ---------------------------------------------------------------------------
+.PHONY: lxdialog
+
+lxdialog:
+ $(MAKE) -C lxdialog all
+
+# ---------------------------------------------------------------------------
+
host-progs := fixdep split-include docproc tkparse
tkparse-objs := tkparse.o tkcond.o tkgen.o
+# fixdep is needed to compile other host programs
+
+split-include docproc $(tkparse-objs) lxdialog: fixdep
+
+
include $(TOPDIR)/Rules.make
diff --git a/scripts/fixdep.c b/scripts/fixdep.c
index d3a4c534cef6..576275914535 100644
--- a/scripts/fixdep.c
+++ b/scripts/fixdep.c
@@ -307,13 +307,12 @@ void parse_dep_file(void *map, size_t len)
clear_config();
while (m < end) {
- while (*m == ' ' || *m == '\\' || *m == '\n')
+ while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
m++;
-
- p = strchr(m, ' ');
- if (!p) {
- p = end;
- while (!isalpha(*p)) p--;
+ p = m;
+ while (p < end && *p != ' ') p++;
+ if (p == end) {
+ do p--; while (!isalnum(*p));
p++;
}
memcpy(s, m, p-m); s[p-m] = 0;