3

In speller.c, the line 89 is :

while ((c = fgetc(fp)) != EOF && isalpha(c));

but shouldn't it be :

while ((c = fgetc(fp)) != EOF && (isalpha(c) || c == '\'');

because a word can contain apostrophe?

5
  • 1
    That's a good catch! It's probably never been noticed because nobody has tested for too long words with apostrophes after the max length! I believe it would treat the chars after the apostrophe as a new word. Look a little further and I think the same logic can be applied at line 100 too! Unless someone can demonstrate otherwise, I think this is a bug! Is it important? In the context of this class, probably not so much since the input data provided will never trip on it. @Kareem , any opinions? ;-)
    – Cliff B
    Jul 28 '15 at 0:36
  • ... or @curiouskiwi? (I hate that I had to make an extra comment to notify two users.)
    – Cliff B
    Jul 28 '15 at 0:36
  • @CliffB I'll test it
    – i_am_david
    Jul 28 '15 at 2:31
  • 1
    Yep... It is a bug! Confirmation: pastebin.com/zeygX8iX
    – i_am_david
    Jul 28 '15 at 2:38
  • I'm impressed wow good job!
    – i_am_david
    Jul 28 '15 at 2:44
1

technically, yes it should be. looks like a bug in speller.c. I reported it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .