How to read from serial in c ? (under linux)

When you're reading a line of text, how do you know it's a new word, and not the same one?