summaryrefslogtreecommitdiff
path: root/graphics/xv/patches/patch-aw
blob: bba52f7a5537c660a32381d6c12c0112f884c68d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
$NetBSD: patch-aw,v 1.2 2002/08/09 18:06:36 drochner Exp $

--- xv.c.orig	Fri Aug  9 19:14:10 2002
+++ xv.c	Fri Aug  9 19:51:18 2002
@@ -1872,11 +1872,13 @@
   if (filenum == LOADPIC) {
     fullname = GetDirFullName();
 
+#ifdef BROKEN_PIPE_HANDLING_FROM_DIRECTORY_BOX
     if (ISPIPE(fullname[0])) {    /* read from a pipe. */
       strcpy(filename, fullname);
       if (readpipe(fullname, filename)) goto FAILED;
       frompipe = 1;
     }
+#endif
   }
   else fullname = namelist[filenum];
 
@@ -1902,6 +1904,7 @@
   }
 
 
+#ifdef BROKEN_PIPE_HANDLING_FROM_DIRECTORY_BOX
   if (filenum == LOADPIC && ISPIPE(fullname[0])) {
     /* if we're reading from a pipe, 'filename' will have the /tmp/xvXXXXXX
        filename, and we can skip a lot of stuff:  (such as prepending 
@@ -1913,6 +1916,9 @@
   }
 
   else {  /* NOT reading from a PIPE */
+#else
+  {
+#endif
 
     /* if fullname doesn't start with a '/' (ie, it's a relative path), 
        (and it's not LOADPIC and it's not the special case '<stdin>') 
@@ -2233,7 +2239,7 @@
   SetISTR(ISTR_INFO,formatStr);
 	
   SetInfoMode(INF_PART);
-  SetISTR(ISTR_FILENAME, 
+  SetISTR(ISTR_FILENAME, "%s",
 	  (filenum==DFLTPIC || filenum==GRABBED || frompipe)
 	  ? "<none>" : basefname);