[neomutt-devel] how does mutt determines if the debugfilename has changed?

toogley at mailbox.org toogley at mailbox.org
Wed Jun 14 09:00:45 CEST 2017


Hey list,

i don't understand

 bool file_changed =
      ((mutt_strlen(debugfilename) - 1) != mutt_strlen(DebugFile) ||
        mutt_strncmp(debugfilename, DebugFile, mutt_strlen(debugfilename) - 1));

from https://github.com/neomutt/neomutt/blob/master/init.c#L2204


As far as i understand, the first comparisons compares the size of the
filename and the second compares the actual string. However:

* I don't understand why the length of debugfilename *minus 1* is
  compared to the one from DebugFile. Shouldn't both use the original
  length?
* I don't understand why the length comparison is needed at all.
  because, when two strings have the same characters, they would also
  have the same length. At least, in my understanding.


Can someone explain these things to me?

Thanks.




More information about the neomutt-devel mailing list