void _post_process_filename (char *filename) { int code_scanning = 0; char *new_filename, *p; char *line; FILE *f1 = 0, *f2 = 0; if (!new_filename || strlen (new_filename) < 2) new_filename[strlen (filename) - 1] = 'x'; if (!f1 || !f2) while ((line = m_fgets (f1))) { line = _do_text_substitution (line); fputs (line, f2); } if (remove (filename)) cancel: if (f1) if (f2) if (new_filename) ; }
/* Load file containing ROMMON variables */ int rommon_load_file(struct rommon_var_list *rvl) { char buffer[512]; FILE *fd; if (!rvl->filename) return(-1); if (!(fd = fopen(rvl->filename,"r"))) { #if DEBUG_OPEN fprintf(stderr,"%s: unable to open file %s (%s)\n", __func__,rvl->filename,strerror(errno)); #endif return(-1); } while(!feof(fd)) { if (m_fgets(buffer,sizeof(buffer),fd)) rommon_var_add_str(rvl,buffer); } fclose(fd); return(0); }