All pastes #618092 Raw Edit

Someone

public text v1 · immutable
·published 2007-07-13 19:04 UTC
rendered paste body
static error_t open_file(void)
{
  SYM_ENTRY *sym;
  char sym_buf[MAX_SYM_LEN];
  char *sym_buf_ptr = sym_buf + MAX_SYM_LEN-1;
  size_t size;
  short *sptr = NULL;
  char *ptr;
  char *mounted;
  char bufsys;
  char *bufString;
  unsigned short size_line = 0, Fsize_line = 0, num_line = 0;

  sprintf(mounted, "%s\\fsys", mounted_rep);

  //MODIFIED
  if(filename[0] == '\\') //If true, active multidirectory mode
  {
  	show_msg("Parsing the file system file....");
	//First we look for the file system config file
	FILE *fsys;
	fsys = fopen(mounted, "r");
	if(!fsys)
		return error(ERR_FILE);



	//Scan the file to have the malloc values
	do
	{
		bufsys = fgetc(fsys);
		if(bufsys != ':') {
			size_line++;
		} else if(bufsys == LF) {
			num_line++;
		} else {
			if(size_line > Fsize_line)
				Fsize_line = size_line;
		}
	}while(bufsys != EOF);

	char *title = malloc(3*sizeof(unsigned char));
	char *message = malloc(3*sizeof(unsigned char));
	sprintf(title, "%d", Fsize_line);
	sprintf(message, "%d", num_line);

	DlgMessage(title, message, BT_OK, BT_NONE);

  }
  //MODFIFIED