[Patch] debian-installer: add a function in libd-i
Hi,
I added a function in libd-i. This function is used in netcfg.
Could someone commit this change please ? And is there any plan to release
libd-i, because ddetect and netcfg use utils.c which is libd-i.
Thanks
--
Thomas Poindessous
thomas@poindessous.com
Index: Makefile
===================================================================
RCS file: /cvs/debian-boot/debian-installer/libd-i/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile 2001/02/09 07:35:17 1.3
+++ Makefile 2002/05/10 13:36:42
@@ -7,7 +7,7 @@
LIBS=$(LIB) $(SONAME) $(LIBNAME)
-OBJS=di_execlog.o di_log.o di_check_dir.o
+OBJS=di_execlog.o di_log.o di_check_dir.o di_snprintfcat.o
PIC_LIB=libd-i_pic.a
@@ -54,7 +54,7 @@
ln -s $(LIBNAME) ${libdir}/$(LIB)
install -m 755 $(PIC_LIB) ${libdir}
install -m 644 d-i.h ${incdir}
-
+
clean:
Index: d-i.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/libd-i/d-i.c,v
retrieving revision 1.4
diff -u -r1.4 d-i.c
--- d-i.c 2001/02/09 08:21:56 1.4
+++ d-i.c 2002/05/10 13:36:42
@@ -28,6 +28,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include <syslog.h>
+#include <stdarg.h>
#include "d-i.h"
@@ -86,3 +87,19 @@
}
#endif /* L__di_check_dir__ */
+
+#ifdef L__di_snprintfcat__
+int
+di_snprintfcat (char *str, size_t size, const char *format, ...)
+{
+ va_list ap;
+ int retval;
+ size_t len = strlen (str);
+
+ va_start (ap, format);
+ retval = vsnprintf (str + len, size - len, format, ap);
+ va_end (ap);
+
+ return retval;
+}
+#endif /* L__di_snprintfcat__ */
Index: d-i.h
===================================================================
RCS file: /cvs/debian-boot/debian-installer/libd-i/d-i.h,v
retrieving revision 1.2
diff -u -r1.2 d-i.h
--- d-i.h 2001/02/05 07:08:40 1.2
+++ d-i.h 2002/05/10 13:36:42
@@ -7,4 +7,4 @@
int di_execlog (const char *incmd);
void di_log(char *msg);
int di_check_dir (const char *dirname);
-
+int di_snprintfcat (char *str, size_t size, const char *format, ...);
Reply to: