(void)close(ifd);
}
+void copy_datafile(int ifd, char *file)
+{
+ if (!file)
+ return;
+ for (;;) {
+ char *sep = strchr(file, ':');
+
+ if (sep) {
+ *sep = '\0';
+ copy_file(ifd, file, 1);
+ *sep++ = ':';
+ file = sep;
+ } else {
+ copy_file(ifd, file, 0);
+ break;
+ }
+ }
+}
+
int main(int argc, char **argv)
{
int ifd = -1;
file = NULL;
}
}
-
- file = params.datafile;
-
- for (;;) {
- char *sep = strchr(file, ':');
- if (sep) {
- *sep = '\0';
- copy_file (ifd, file, 1);
- *sep++ = ':';
- file = sep;
- } else {
- copy_file (ifd, file, 0);
- break;
- }
- }
+ copy_datafile(ifd, params.datafile);
} else if (params.type == IH_TYPE_PBLIMAGE) {
/* PBL has special Image format, implements its' own */
pbl_load_uboot(ifd, ¶ms);