mtd/drivers/mtd/devices phram.c,1.13,1.14

joern at infradead.org joern at infradead.org
Mon Mar 7 16:43:42 EST 2005


Update of /home/cvs/mtd/drivers/mtd/devices
In directory phoenix.infradead.org:/home/joern/mtd/drivers/mtd/devices

Modified Files:
	phram.c 
Log Message:
Accept newline at the end of input.



Index: phram.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/phram.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- phram.c	7 Mar 2005 20:53:25 -0000	1.13
+++ phram.c	7 Mar 2005 21:43:38 -0000	1.14
@@ -218,6 +218,15 @@
 	return 0;
 }
 
+
+static inline void kill_final_newline(char *str)
+{
+	char *newline = strrchr(str, '\n');
+	if (newline && !newline[1])
+		*newline = 0;
+}
+
+
 #define parse_err(fmt, args...) do {	\
 	ERROR(fmt , ## args);	\
 	return 0;		\
@@ -236,6 +245,7 @@
 		parse_err("parameter too long\n");
 
 	strcpy(str, val);
+	kill_final_newline(str);
 
 	for (i=0; i<3; i++)
 		token[i] = strsep(&str, ",");





More information about the linux-mtd-cvs mailing list