~ubuntu-branches/ubuntu/precise/eglibc/precise-201308281639

« back to all changes in this revision

Viewing changes to debian/patches/any/cvs-fopen.diff

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-02-08 01:58:09 UTC
  • mfrom: (1.5.3) (288.1.12 precise)
  • Revision ID: package-import@ubuntu.com-20120208015809-ulscst7uteq3e22z
Tags: 2.15~pre6-0ubuntu10
Merge from Debian (r5151, 2.13-26).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
2011-04-22  Ulrich Drepper  <drepper@gmail.com>
2
 
 
3
 
        [BZ #12685]
4
 
        * libio/fileops.c (_IO_new_file_fopen): Scan up to 7 bytes of the
5
 
        mode string.
6
 
        Patch by Eric Blake <eblake@redhat.com>.
7
 
 
8
 
diff --git a/libio/fileops.c b/libio/fileops.c
9
 
index eba2768..ea730ac 100644
10
 
--- a/libio/fileops.c
11
 
+++ b/libio/fileops.c
12
 
@@ -290,7 +290,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
13
 
 #ifdef _LIBC
14
 
   last_recognized = mode;
15
 
 #endif
16
 
-  for (i = 1; i < 6; ++i)
17
 
+  for (i = 1; i < 7; ++i)
18
 
     {
19
 
       switch (*++mode)
20
 
        {
21
 
@@ -997,18 +997,18 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
22
 
       /* Adjust for read-ahead (bytes is buffer). */
23
 
       offset -= fp->_IO_read_end - fp->_IO_read_ptr;
24
 
       if (fp->_offset == _IO_pos_BAD)
25
 
-        {
26
 
-          if (mode != 0)
27
 
-            goto dumb;
28
 
-          else
29
 
-            {
30
 
-              result = _IO_SYSSEEK (fp, 0, dir);
31
 
-              if (result == EOF)
32
 
-                return result;
33
 
-
34
 
-              fp->_offset = result;
35
 
-            }
36
 
-        }
37
 
+       {
38
 
+         if (mode != 0)
39
 
+           goto dumb;
40
 
+         else
41
 
+           {
42
 
+             result = _IO_SYSSEEK (fp, 0, dir);
43
 
+             if (result == EOF)
44
 
+               return result;
45
 
+
46
 
+             fp->_offset = result;
47
 
+           }
48
 
+       }
49
 
       /* Make offset absolute, assuming current pointer is file_ptr(). */
50
 
       offset += fp->_offset;
51
 
       if (offset < 0)
52
 
@@ -1270,7 +1270,7 @@ _IO_new_file_write (f, data, n)
53
 
        {
54
 
          f->_flags |= _IO_ERR_SEEN;
55
 
          break;
56
 
-        }
57
 
+       }
58
 
       to_do -= count;
59
 
       data = (void *) ((char *) data + count);
60
 
     }
61
 
@@ -1358,12 +1358,12 @@ _IO_new_file_xsputn (f, data, n)
62
 
       do_write = to_do - (block_size >= 128 ? to_do % block_size : 0);
63
 
 
64
 
       if (do_write)
65
 
-        {
66
 
+       {
67
 
          count = new_do_write (f, s, do_write);
68
 
          to_do -= count;
69
 
          if (count < do_write)
70
 
            return n - to_do;
71
 
-        }
72
 
+       }
73
 
 
74
 
       /* Now write out the remainder.  Normally, this will fit in the
75
 
         buffer, but it's somewhat messier for line-buffered files,