agsinject: fix return value, rename on windows
commitdfecf83fb3caeaa5dc9b779c7f21c5e020608bad
authorrofl0r <rofl0r@users.noreply.github.com>
Mon, 29 Aug 2022 22:53:33 +0000 (29 22:53 +0000)
committerrofl0r <rofl0r@users.noreply.github.com>
Mon, 29 Aug 2022 22:53:33 +0000 (29 22:53 +0000)
treee00f4d6a7f9d785792c117388a96675e6e38851a
parentcecb4d34d005a73a87f6b2cbcdd28e5b4a50e941
agsinject: fix return value, rename on windows

the logic processing the return value from inject() was actually
wrong, it returned success in some cases even on error.
also, rename() on windows doesn't work like on unix, overwriting
the destination, therefore we need to delete the target first.
in my experiments with wine i couldn't get rename() to work anyway,
but this might be due to a bug in wine.
in such a case we now print the temp filename, so the user can
manually copy the file to its destination.

closes #29
agsinject.c