On Thursday 04 March 2010 20:23:21 Daniel Seither wrote:
Currently, running batctl from the home directory leads to warnings ("Warning - mac already known") if ~/bat-hosts exists. This is caused by batctl parsing both "~/bat-hosts" and "bat-hosts" which happen to be the same file when the working directory is ~
This patch adds duplicate file name detection to bat_hosts_init() to avoid these warnings.
I tested your patch and it works very well. That is a nice catch! I did not stumble over this problem before. However, I wonder whether it would be better to let realpath() allocate the normalized file path buffer instead of using the static normalized array, simply to save some disk space. What do you think ?
Cheers, Marek