summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/utils/pdfopen/README9
-rw-r--r--Build/source/utils/pdfopen/pdfopen.c6
2 files changed, 9 insertions, 6 deletions
diff --git a/Build/source/utils/pdfopen/README b/Build/source/utils/pdfopen/README
index 0e3e13b1dc2..3072326118c 100644
--- a/Build/source/utils/pdfopen/README
+++ b/Build/source/utils/pdfopen/README
@@ -1,7 +1,7 @@
---------------------------------------------------------
-Pdfopen 0.5 - Send open/close commands to Acrobat Reader
---------------------------------------------------------
+---------------------------------------------------------
+Pdfopen 0.51 - Send open/close commands to Acrobat Reader
+---------------------------------------------------------
This is a Linux (X11) implementation of Fabrice Popineau's pdfclose/
pdfopen commands to control the Acrobat Reader.
@@ -19,6 +19,9 @@ building under X11R5, handles pathnames on the command-line,
and fixes a bug where pdfopen did not exit correctly after
(automatically) starting acroread.
+Version 0.51 uses the strrchr() function instead of rindex()
+to allow compilation on non-BSD derived unix platforms.
+
The command lines do not behave precisely the same as under Windows,
because the Linux Reader behaves somewhat different: it is not
scriptable, but it is possible to 'fake' keypresses.
diff --git a/Build/source/utils/pdfopen/pdfopen.c b/Build/source/utils/pdfopen/pdfopen.c
index f4eba4b3cfb..26ea994419b 100644
--- a/Build/source/utils/pdfopen/pdfopen.c
+++ b/Build/source/utils/pdfopen/pdfopen.c
@@ -11,7 +11,7 @@ extern int sendx_control_token(char *,char *);
extern int sendx_alt_token(char *,char *);
void usage (void) {
- puts ("pdfopen 0.5: you are mistaking me for an actual program.\n");
+ puts ("pdfopen 0.51: you are mistaking me for an actual program.\n");
puts(" pdfopen [--file filename.pdf]");
puts ("\nusing no arguments tells the Reader to 'go back'.\n");
}
@@ -41,8 +41,8 @@ int main (int argc, char **argv){
}
strcpy(filename,argv[2]);
strcpy(basefile,filename);
- if (rindex(basefile,'/'))
- basefile = rindex(basefile,'/')+1;
+ if (strrchr(basefile,'/'))
+ basefile = strrchr(basefile,'/')+1;
winname = malloc(strlen(argv[2])+1+strlen(READERWINPREFIX));
if (winname == NULL ) {