pan-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pan-users] Bug 756458 pan 0.139 crashes on start


From: Petr Kovar
Subject: Re: [Pan-users] Bug 756458 pan 0.139 crashes on start
Date: Wed, 13 Jan 2016 17:11:47 +0100

On Thu, 7 Jan 2016 18:53:53 +0100
Detlef Graef <address@hidden> wrote:

> Am 06.01.2016 um 20:19 schrieb Rhialto:
> 
> > On Wed 06 Jan 2016 at 14:04:10 +0100, Detlef Graef wrote:
> >> Is this fix ok?
> > 
> > Disclaimer: I don't know the innards of Pan and I hardly ever use C++,
> > but it looks like an improvement to me.
> 
> [...]
> 
> > 
> > So keeping every step of the way in the StringView realm is definitely
> > better. Whether the actual string storage is safe in the long term, I
> > didn't look at, but presumably it is or more things would go wrong
> > (probably).
> 
> Maybe someone can tell me if the function "c_str()" from std::string can
> be simply replaced with "str" from StringView struct?
> 
> See line 72 here:
> 
> https://git.gnome.org/browse/pan2/tree/pan/general/string-view.h
> 
> > This pattern may occur in more places, of course...
> 
> Yes, I know, same problem seems to be in file prefs.cc:
> 
> >-----------------------------------------------------------
> 
> std::string
> Prefs :: get_color_str (const StringView& key, const GdkColor& fallback)
> const
> {
>   return color_to_string (get_color (key, fallback));
> }
> 
> std::string
> Prefs :: get_color_str (const StringView& key, const StringView&
> fallback) const
> {
>   return color_to_string (get_color (key, fallback));
> }
> 
> /* get string without fallback option */
> std::string
> Prefs :: get_color_str_wo_fallback (const StringView& key) const
> {
>   std::string res;
>   if (!_colors.count(key)) return "";
>   const GdkColor& col(_colors[key]);
>   return color_to_string (col);
> }
> 
> >-----------------------------------------------------------
> 
> There are some more of this.
> 
> 
> Just in case I can provide a patch (I need confirmation that patch is
> probably ok):
> 
> Can someone commit patches to the git repository of Pan? I suppose a
> commit can be rolled back :-)

Thanks a lot for providing the patch. Sorry it took a while but I've
now pushed the patch to master as 366372076042687a0bf21cf72c7693e4a7c2b3d6.

Everybody, even if you haven't been experiencing crashes at pan startup,
please test the new code in master thoroughly and report any bugs.

> How should a patch be provided? Something like:
> 
> "diff -u <old-source-file> <new-source-file>"

It's best to first commit your changes and then run something like:

git format-patch master --stdout > myfix.patch

Looking forward to seeing more patches in the future. Thanks again. :)

pk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]