mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
update binres tools and fix renaming bug
svn path=/trunk/; revision=10356
This commit is contained in:
parent
5efcf7ad5c
commit
da6bb56348
1 changed files with 14 additions and 3 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <limits.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
@ -182,8 +183,18 @@ int process_resources(const char* input_file_name, const char* specific_file_nam
|
|||
if (inserting)
|
||||
{
|
||||
fclose(ftmp);
|
||||
if (c == EOF && rename(tmp_file_name, input_file_name) < 0)
|
||||
c = '.'; /* force an error */
|
||||
if (c == EOF)
|
||||
{
|
||||
if (rename(tmp_file_name, input_file_name) < 0)
|
||||
{
|
||||
/* try unlinking first, Windows rename is brain-damaged */
|
||||
if (unlink(input_file_name) < 0 || rename(tmp_file_name, input_file_name) < 0)
|
||||
{
|
||||
unlink(tmp_file_name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else unlink(tmp_file_name);
|
||||
}
|
||||
|
||||
|
@ -197,7 +208,7 @@ int main(int argc, char **argv)
|
|||
const char* input_file_name = 0;
|
||||
const char* specific_file_name = 0;
|
||||
|
||||
while((optc = getopt(argc, argv, "axi:o:fh")) != EOF)
|
||||
while((optc = getopt(argc, argv, "axi:o:fhv")) != EOF)
|
||||
{
|
||||
switch(optc)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue