~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/readline.cc

MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
                           MYF(MY_WME))) == MY_FILE_ERROR)
171
171
    return (size_t) -1;
172
172
 
173
 
  DBUG_PRINT("fill_buff", ("Got %lu bytes", (ulong) read_count));
174
 
 
175
173
  /* Kludge to pretend every nonempty file ends with a newline. */
176
174
  if (!read_count && bufbytes && buffer->end[-1] != '\n')
177
175
  {
190
188
{
191
189
  char *pos;
192
190
  size_t length;
193
 
  DBUG_ENTER("intern_read_line");
 
191
 
194
192
 
195
193
  buffer->start_of_line=buffer->end_of_line;
196
194
  for (;;)
203
201
      if ((uint) (pos - buffer->start_of_line) < buffer->max_size)
204
202
      {
205
203
        if (!(length=fill_buffer(buffer)) || length == (size_t) -1)
206
 
          DBUG_RETURN(0);
 
204
          return(0);
207
205
        continue;
208
206
      }
209
207
      pos--;                                    /* break line here */
210
208
    }
211
209
    buffer->end_of_line=pos+1;
212
210
    *out_length=(ulong) (pos + 1 - buffer->eof - buffer->start_of_line);
213
 
    DBUG_RETURN(buffer->start_of_line);
 
211
    return(buffer->start_of_line);
214
212
  }
215
213
}