Implementation for sys/stat.h #59
Implementation for sys/stat.h #59ricardocvel wants to merge 12 commits intodevs/expertise/native-windowsfrom
Conversation
Coquinho
left a comment
There was a problem hiding this comment.
Your implementation should be an evil_ not an unposix/, so please move stah{h,c} to evil/evil_stat.{h,c}.
|
how exactly can we test it? |
5f9f866 to
62d2389
Compare
62d2389 to
4235c4f
Compare
4235c4f to
598bc10
Compare
joaoantoniocardoso
left a comment
There was a problem hiding this comment.
I am changing my approval to be clear that some work still needs to be done.
187ed15 to
700df59
Compare
joaoantoniocardoso
left a comment
There was a problem hiding this comment.
Almost there, just some minor changes for me.
Is there some way to test it?
a1ad61f to
c506a45
Compare
Coquinho
left a comment
There was a problem hiding this comment.
How can I test this?
And another thing, should these new things be inside some #ifndef CYGWIN(don't remember if it's exactly like that) as this isn't needed when building with it, but only when building windows natively?
joaoantoniocardoso
left a comment
There was a problem hiding this comment.
#169 changed EAPI to EVIL_API
Update stat.h
Update stat.c
Update stat.h
Update stat.c
Update stat.h
including Windows.h at WIN_LEAN_AND_MEAN.
Co-authored-by: Lucas <Coquinho@users.noreply.github.com>
moving stat. {h, c) for evil / evil stat. {h, c}
deleting items, which were copied to another directory
…c' in lib/evil/meson.build
584be66 to
6f33c48
Compare
…pertisesolutions/efl into devs/expertise-ricardo/sys/stat.h
| { | ||
| int r_fstatat; | ||
|
|
||
| if (pathname[1] == ':' && pathname[2] == '\\' || pathname[2] == '/' ) |
There was a problem hiding this comment.
You must check the buffer size before accessing it.
| do | ||
| { | ||
| pathbuf_size += MAX_PATH; | ||
| pathbuf = realloc(pathbuf, pathbuf_size * sizeof(char)); |
There was a problem hiding this comment.
The memory allocated here is never freed.
| } | ||
|
|
||
| size_str = strlen(pathbuf) + strlen(pathname); | ||
| char *path_complete = malloc(sizeof(char) * size_str + 1); |
There was a problem hiding this comment.
The memory allocated here is never freed.
| size_str = strlen(pathbuf) + strlen(pathname); | ||
| char *path_complete = malloc(sizeof(char) * size_str + 1); | ||
| strcpy(path_complete, pathbuf); | ||
| strcat(path_complete, pathname); |
There was a problem hiding this comment.
What if pathbuf doesn't end with a path separator?
| if (flags == AT_SYMLINK_NOFOLLOW) | ||
| r_fstatat = stat(pathname, statbuf); | ||
| else | ||
| r_fstatat = stat(pathname, statbuf); |
There was a problem hiding this comment.
Why the if both calls are exactly the same?
| pathbuf[size_str + 1] = 0; | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
What about using _splitpath instead of a manual for loop?
| else | ||
| { | ||
| r_fstatat = stat(path_complete, statbuf); | ||
| } |
Coquinho
left a comment
There was a problem hiding this comment.
Hey guys, what do you think about breaking this in 2 PR? We could have one with the functions, which seems to still have some loose ends, and we can approve the definitions, as it seems there is no discussion there.
This PR aims to implement the function:
for Windows;
and declare the functions in stat.h:
(using the header: <corecrt_io.h> and <errno.h>)