diff options
author | jlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2007-03-26 16:28:00 +0000 |
---|---|---|
committer | jlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2007-03-26 16:28:00 +0000 |
commit | f42414bf8a43f4c1b464bf1de9d357edba4fd439 (patch) | |
tree | 9806741231e7f9631caa935316f9a89a930ee961 /cgi-bin/help-index.c | |
parent | f899b121701998b043508771602bb641a5f8d895 (diff) | |
download | cups-f42414bf8a43f4c1b464bf1de9d357edba4fd439.tar.gz |
Load cups into easysw/current.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@299 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cgi-bin/help-index.c')
-rw-r--r-- | cgi-bin/help-index.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/cgi-bin/help-index.c b/cgi-bin/help-index.c index df909a406..8be6bc3a5 100644 --- a/cgi-bin/help-index.c +++ b/cgi-bin/help-index.c @@ -1,5 +1,5 @@ /* - * "$Id: help-index.c 6258 2007-02-11 01:16:31Z mike $" + * "$Id: help-index.c 6394 2007-03-25 00:01:14Z mike $" * * On-line help index routines for the Common UNIX Printing System (CUPS). * @@ -899,6 +899,7 @@ help_load_file( cups_file_t *fp; /* HTML file */ help_node_t *node; /* Current node */ char line[1024], /* Line from file */ + temp[1024], /* Temporary word */ section[1024], /* Section */ *ptr, /* Pointer into line */ *anchor, /* Anchor name */ @@ -1150,6 +1151,7 @@ help_load_file( */ for (ptr ++; *ptr && *ptr != '>'; ptr ++) + { if (*ptr == '\"' || *ptr == '\'') { for (quote = *ptr++; *ptr && *ptr != quote; ptr ++); @@ -1157,6 +1159,7 @@ help_load_file( if (!*ptr) ptr --; } + } if (!*ptr) ptr --; @@ -1188,18 +1191,18 @@ help_load_file( wordlen = ptr - text; - if (*ptr) - *ptr = '\0'; - else - ptr --; + memcpy(temp, text, wordlen); + temp[wordlen] = '\0'; + + ptr --; - if (wordlen > 1 && !bsearch(text, help_common_words, + if (wordlen > 1 && !bsearch(temp, help_common_words, (sizeof(help_common_words) / sizeof(help_common_words[0])), sizeof(help_common_words[0]), (int (*)(const void *, const void *)) strcasecmp)) - help_add_word(node, text); + help_add_word(node, temp); } } @@ -1333,5 +1336,5 @@ help_sort_words(help_word_t *w1, /* I - Second word */ /* - * End of "$Id: help-index.c 6258 2007-02-11 01:16:31Z mike $". + * End of "$Id: help-index.c 6394 2007-03-25 00:01:14Z mike $". */ |