[BusyBox-cvs] busybox/networking ifupdown.c,1.11,1.12
Glenn McGrath
bug1 at busybox.net
Fri Dec 6 11:51:50 UTC 2002
Update of /var/cvs/busybox/networking
In directory winder:/tmp/cvs-serv28185
Modified Files:
ifupdown.c
Log Message:
Use libbb/get_line_from_file, change default state file location
Index: ifupdown.c
===================================================================
RCS file: /var/cvs/busybox/networking/ifupdown.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ifupdown.c 6 Dec 2002 08:35:55 -0000 1.11
+++ ifupdown.c 6 Dec 2002 11:51:46 -0000 1.12
@@ -3,7 +3,10 @@
* Based on ifupdown by Anthony Towns
* Copyright (c) 1999 Anthony Towns <aj at azure.humbug.org.au>
*
+ * Changes to upstream version
* Remove checks for kernel version, assume kernel version 2.2.0 or better
+ * Lines in the interfaces file cannot wrap.
+ * The default state file is moved to /var/run/ifstate
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -605,77 +608,6 @@
[...259 lines suppressed...]
- pch--;
- }
- *(pch + 1) = '\0';
-
- pch = buf;
- while (isspace(*pch)) {
- pch++;
- }
-
- add_to_state(&state, &n_state, &max_state, xstrdup(pch));
+ char *start;
+ while ((start = get_line_from_file(state_fp)) != NULL) {
+ char *end_ptr;
+ /* We should only need to check for a single character */
+ end_ptr = start + strcspn(start, " \t\n");
+ *end_ptr = '\0';
+ add_to_state(&state, &n_state, &max_state, start);
}
}
More information about the busybox-cvs
mailing list