Re: [RFA 03/23] Use gdb_file_up in find_and_open_script

Tom Tromey
2017-07-23T16:08:54Z

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

>> -extern int find_and_open_script (const char *file, int search_path,
>> - FILE **streamp, char **full_path);
>> +extern gdb_file_up
>> + find_and_open_script (const char *file, int search_path,
>> + gdb::unique_xmalloc_ptr<char> *full_path);
>>

Pedro> Though I wonder whether using gdb::optional wouldn't look clearer:

Pedro> /* The script that was opened. */
Pedro> struct open_script
Pedro> {
Pedro> gdb_file_up stream;
Pedro> gdb::unique_xmalloc_ptr<char> full_path;
Pedro> };

[...]

I went ahead and did it this way.

Tom