hi Pascal,
On Saturday 29 March 2008 21:25, Pascal Bellard wrote:
> Please find attached a patch-file to add 'cpio -o -H newc' feature.
Patch seems to have rather inconsistent tab/space usage
and occasional broken indentation (or maybe it only looks
wrong when I set tab == 8 spaces...)
struct inodes_s *inode = xzalloc(sizeof(*inode));
+
+ if (!inode) {
+ abort_cpio_o:
+ bb_perror_msg_and_die(name);
+ }
xzalloc never returns NULL.
+ if (line) {
+ /* Strip leading `./' from the filename. */
+ for (name = line; name[0] == '.' && name[1] == '/';) {
+ while (*++name == '/');
+ }
I find this use of for() to be a bit of excercise in
"how can I use for() for this?". I prefer "how to do it
efficiently, _yet_ not hard to understand?"
In this case:
name = line;
while (name[0] == '.' && name[1] == '/') {
while (*++name == '/')
continue;
}
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox