start work, but buggy

git-svn-id: svn://kolibrios.org@6727 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
siemargl 2016-11-18 16:37:20 +00:00
parent ba50660e2b
commit 42c234aecf
3 changed files with 46 additions and 16 deletions

View File

@ -273,7 +273,7 @@ UNZIP_H = unzip.h unzpriv.h globals.h
all: unzip$(EXE)
unzip$(EXE): $(OBJU) $(LIBBZIP2)
$(LD) $(LDFLAGS) $(LDVER) $(OBJU) $(LD_BZ2LIB) $(LDLIBS)
$(LD) $(LDFLAGS) $(LDVER) $(OBJU) $(LD_BZ2LIB) $(LDLIBS) -Map=unzip.exe.map
kos32-objcopy $@ -O binary
unzipsfx$(EXE): $(OBJX) $(LIBBZIP2X)

View File

@ -116,7 +116,7 @@ struct dirent* readdir(DIR *dirp)
int rc = sf_file(1, &di); // read dir
if(rc) {
fprintf(stderr, "Error %d reading dir item %s", rc, dirp->entry.d_name);
fprintf(stderr, "Error %d reading dir item %s\n", rc, dirp->entry.d_name);
errno = rc;
return NULL;
}
@ -144,20 +144,52 @@ void rewinddir(DIR *dirp)
int mkdir(const char *_path, mode_t m)
{
struct fs_dirinfo di;
memset(&di, 0, sizeof di);
di.ppath = (char*)_path;
char namebuffer[1050]; // need for save data after di!!!
struct fs_dirinfo *di = (struct fs_dirinfo *)namebuffer;
int rc = sf_file(9, &di); // creat dir
debug_board_printf("mkdir start (%s)\n", _path);
memset(di, 0, sizeof(struct fs_dirinfo));
//di.ppath = (char*)_path; // dont work with 70.9
strcpy(di->path, _path);
int rc = sf_file(9, di); // creat dir
if(rc) {
fprintf(stderr, "Error %d creating dir item %s", rc, _path);
fprintf(stderr, "Error %d creating dir item %s\n", rc, _path);
errno = rc;
return -1;
}
debug_board_printf("mkdir end (%s)\n", _path);
return 0;
}
////////////////////////////////////////////////////////////////////////////////////////
void __attribute__ ((noinline)) debug_board_write_str(const char* str){
while(*str)
debug_board_write_byte(*str++);
}
void __attribute__ ((noinline)) debug_board_printf(const char *format,...)
{
va_list ap;
char log_board[300];
va_start (ap, format);
vsnprintf(log_board, sizeof log_board, format, ap);
va_end(ap);
debug_board_write_str(log_board);
}
__attribute__ ((noinline)) void trap(int n)
{
// nothing todo, just see n in debugger. use "bp trap" command
__asm__ __volatile__(
"nop"
:
:"a"(n));
}
/* tested example
void* read_folderdata(char* name)

View File

@ -91,13 +91,9 @@ int mapattr(__G)
/********************************************************************************************************************/
/*** Function checkdir() */
/*** Function mapname() */
/********************************************************************************************************************/
/************************/
/* Function mapname() */
/************************/
int mapname(__G__ renamed)
__GDEF
int renamed;
@ -212,7 +208,8 @@ int mapname(__G__ renamed)
/* disable control character filter when requested,
* else allow 8-bit characters (e.g. UTF-8) in filenames:
*/
;
if ((isprint(workch) || (128 <= workch && workch <= 254)))
*pp++ = (char)workch;
/*kos
if (uO.cflxflag ||
(isprint(workch) || (128 <= workch && workch <= 254)))
@ -350,9 +347,10 @@ int mapname(__G__ renamed)
/***********************/
/* Function checkdir() */
/***********************/
/********************************************************************************************************************/
/*** Function checkdir() */
/********************************************************************************************************************/
int checkdir(__G__ pathcomp, flag)
__GDEF