Subversion Repositories Kolibri OS

Rev

Rev 1906 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1906 Rev 3065
Line 96... Line 96...
96
 
96
 
Line 97... Line 97...
97
  s = buf;
97
  s = buf;
Line 98... Line -...
98
 
-
 
99
  CHECK_INIT(ptr, fp);
98
 
100
 
99
  CHECK_INIT(ptr, fp);
101
  __sfp_lock_acquire ();
100
 
102
  _flockfile (fp);
101
  _flockfile (fp);
103
#ifdef __SCLE
102
#ifdef __SCLE
Line 112... Line 111...
112
	    break;
111
	    break;
113
	}
112
	}
114
      if (c == EOF && s == buf)
113
      if (c == EOF && s == buf)
115
        {
114
        {
116
          _funlockfile (fp);
115
          _funlockfile (fp);
117
	  __sfp_lock_release ();
-
 
118
          return NULL;
116
          return NULL;
119
        }
117
        }
120
      *s = 0;
118
      *s = 0;
121
      _funlockfile (fp);
119
      _funlockfile (fp);
122
      __sfp_lock_release ();
-
 
123
      return buf;
120
      return buf;
124
    }
121
    }
125
#endif
122
#endif
Line 126... Line 123...
126
 
123
 
Line 136... Line 133...
136
	    {
133
	    {
137
	      /* EOF: stop with partial or no line */
134
	      /* EOF: stop with partial or no line */
138
	      if (s == buf)
135
	      if (s == buf)
139
                {
136
                {
140
                  _funlockfile (fp);
137
                  _funlockfile (fp);
141
		  __sfp_lock_release ();
-
 
142
                  return 0;
138
                  return 0;
143
                }
139
                }
144
	      break;
140
	      break;
145
	    }
141
	    }
146
	  len = fp->_r;
142
	  len = fp->_r;
Line 162... Line 158...
162
	  fp->_r -= len;
158
	  fp->_r -= len;
163
	  fp->_p = t;
159
	  fp->_p = t;
164
	  _CAST_VOID memcpy ((_PTR) s, (_PTR) p, len);
160
	  _CAST_VOID memcpy ((_PTR) s, (_PTR) p, len);
165
	  s[len] = 0;
161
	  s[len] = 0;
166
          _funlockfile (fp);
162
          _funlockfile (fp);
167
	  __sfp_lock_release ();
-
 
168
	  return (buf);
163
	  return (buf);
169
	}
164
	}
170
      fp->_r -= len;
165
      fp->_r -= len;
171
      fp->_p += len;
166
      fp->_p += len;
172
      _CAST_VOID memcpy ((_PTR) s, (_PTR) p, len);
167
      _CAST_VOID memcpy ((_PTR) s, (_PTR) p, len);
173
      s += len;
168
      s += len;
174
    }
169
    }
175
  while ((n -= len) != 0);
170
  while ((n -= len) != 0);
176
  *s = 0;
171
  *s = 0;
177
  _funlockfile (fp);
172
  _funlockfile (fp);
178
  __sfp_lock_release ();
-
 
179
  return buf;
173
  return buf;
180
}
174
}
Line 181... Line 175...
181
 
175