sysvinit-devel
[Top][All Lists]
Advanced

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

[sysvinit-devel] bootlogd Tab Question


From: Marc Smith
Subject: [sysvinit-devel] bootlogd Tab Question
Date: Tue, 20 Jan 2015 12:16:07 -0500

Hi,

I noticed an issue with bootlogd where lines beginning with a tab character are not written to the log file. In bootlogd.c I'm looking at lines 389 through 393... this snippet:

--snip--
case '\t':
    line.pos += (line.pos / 8 + 1) * 8;
    if (line.pos >= (int)sizeof(line.buf))
        line.pos = sizeof(line.buf) - 1;
    break;
--snip--

So when the character is a tab, we're advancing line.pos and we start writing the output to line.buf after this, but the problem is when we write the buffer to the file (fprintf() in line 412) we get nothing printed to the file since line.buf + 0 .. 7 is \0.

I don't understand the intention of this block of code, but I assume its so we don't print a tab character to the log file. Perhaps instead just print spaces (8 or 4 or X) to the file in-place of tabs?

I looked at the latest bootlogd.c from trunk (http://svn.savannah.nongnu.org/viewvc/sysvinit/trunk/src/bootlogd.c?root=sysvinit&view=markup) and compared it to the version I'm using (2.88dsf) and it appears it would function the same. The line numbers I referenced above are taken from the trunk version.

Any help would be greatly appreciated.


Thanks,

Marc

reply via email to

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