Yep

On 23/02/2013 14:33, serge-sans-paille wrote:
> In pythran/pythonic++/core/file.h:
> 
>> +					// Putting a '\0' after relevant info even if size is > number of bits in file.
>> +					content[fread(content, sizeof(char), size, **data)] = '\0';
>> +					core::string res(content);
>> +					delete[] content;
>> +					return res;
>> +				}
>> +
>> +				core::string readline() {
>> +					if(not is_open) throw ValueError("I/O operation on closed file");
>> +					if (mode.find_first_of("r+") == std::string::npos)
>> +						throw IOError("File not open for reading");
>> +					char *content = NULL;
>> +					size_t n=0; // Useless but must be given to readline. NULL => segfault
>> +					getline(&content, &n, **data);
>> +					core::string res(content);
>> +					free(content);
> 
> That's where a nice implem of core::string would avoid the extra buffer
> copy :'(
> 
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/serge-sans-paille/pythran/pull/49/files#r3126661>.
>