struct main_info
{
- main_info () = default;
-
- ~main_info ()
- {
- xfree (name_of_main);
- }
-
/* Name of "main". */
- char *name_of_main = nullptr;
+ std::string name_of_main;
/* Language of "main". */
{
struct main_info *info = get_main_info ();
- if (info->name_of_main != NULL)
+ if (!info->name_of_main.empty ())
{
- xfree (info->name_of_main);
- info->name_of_main = NULL;
+ info->name_of_main.clear ();
info->language_of_main = language_unknown;
}
if (name != NULL)
{
- info->name_of_main = xstrdup (name);
+ info->name_of_main = name;
info->language_of_main = lang;
}
}
{
struct main_info *info = get_main_info ();
- if (info->name_of_main == NULL)
+ if (info->name_of_main.empty ())
find_main_name ();
- return info->name_of_main;
+ return info->name_of_main.c_str ();
}
/* Return the language of the main function. If it is not known,
{
struct main_info *info = get_main_info ();
- if (info->name_of_main == NULL)
+ if (info->name_of_main.empty ())
find_main_name ();
return info->language_of_main;