Skip to content

Commit

Permalink
replaced getopt by a version with BSD license; removed unistd.h repla…
Browse files Browse the repository at this point in the history
…cement
  • Loading branch information
max-boehm committed Apr 29, 2014
1 parent b900e7a commit a23a1c6
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 1,493 deletions.
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ main(int argc,char **argv)

while((file = *argv++))
{
inptr = fopen(file,"rb"); /* 'b' is required for WINDOWS */
inptr = fopen(file,"rb");
if(inptr == FNULL)
{
fprintf(stderr,"%s: failed to open file %s\n",Progname,file);
Expand Down
2 changes: 1 addition & 1 deletion readfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static char *ModuleId = "@(#) $Id: readfile.c,v 1.30 2005/07/24 18:15:28 alex Ex


#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include <sys/types.h>
#include <string.h>
#include <ctype.h>
Expand Down
15 changes: 8 additions & 7 deletions win/README_WIN.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,29 @@ http://archive.ubuntu.com/ubuntu/pool/universe/e/exifprobe/exifprobe_2.0.1.orig.
when exifprobe is build under Windows.
- a file byteorder.h with defines NATIVE_BYTEORDER_LITTLE_ENDIAN
- a file comptime.h
- a replacement for unistd.h from http://stackoverflow.com/a/826027
- a replacement for getopt.h and getopt.c from https://gist.github.com/ashelly/7776712
- a file snprintf.c with an implementation of snprintf(), see http://stackoverflow.com/a/13067917/321013
- an empty file as a replacement for unistd.h
- a replacement for getopt.h and getopt.c (with BSD license) from
http://www.rohitab.com/discuss/topic/39420-a-proper-port-of-getopt/
- a file snprintf.c which wrapps the Windows _snprintf() function to work around its non
standard negative return value, see http://stackoverflow.com/a/13067917/321013

* The following modifications had to be applied to the original 2.0.1 source code

diff exifprobe-2.0.1.orig/main.c exifprobe-2.0.1/main.c
86c86
< inptr = fopen(file,"r");
---
> inptr = fopen(file,"rb"); /* FOR WINDOWS */
> inptr = fopen(file,"rb");

diff exifprobe-2.0.1.orig/process.c exifprobe-2.0.1/process.c
254c254,255
< fseek(inptr,0L,current_offset);
---
> /* fseek(inptr,0L,current_offset); */ /* BUGFIX */
> fseek(inptr,current_offset, 0);
> fseek(inptr,current_offset,0);

diff exifprobe-2.0.1.orig/readfile.c exifprobe-2.0.1/readfile.c
25a26
> #include <unistd.h>
> #include <stdint.h>

* To generate the Windows executable open and build the solution exifprobe.sln
in Visual Studio 2010 or later.
Expand Down
Loading

0 comments on commit a23a1c6

Please sign in to comment.