Add patch to remove some more references to identi.ca
[debian/bti.git] / config.c
index e06f480bc87078a5585e373a035634042332ee9a..e6fecc1d3975f350ddb4e6267566d454d4d0c5f1 100644 (file)
--- a/config.c
+++ b/config.c
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
 #define _GNU_SOURCE
@@ -227,10 +223,6 @@ static int host_callback(struct session *session, char *value)
                session->host = HOST_TWITTER;
                session->hosturl = strdup(twitter_host);
                session->hostname = strdup(twitter_name);
-       } else if (strcasecmp(value, "identica") == 0) {
-               session->host = HOST_IDENTICA;
-               session->hosturl = strdup(identica_host);
-               session->hostname = strdup(identica_name);
        } else {
                session->host = HOST_CUSTOM;
                session->hosturl = strdup(value);
@@ -254,7 +246,7 @@ static int action_callback(struct session *session, char *value)
        else if (strcasecmp(value, "group") == 0)
                session->action = ACTION_GROUP;
        else
-               session->action= ACTION_UNKNOWN;
+               session->action = ACTION_UNKNOWN;
        return 0;
 }
 
@@ -311,7 +303,7 @@ static void process_line(struct session *session, char *key, char *value)
                if (strncasecmp(item->key, key, strlen(item->key)) == 0) {
                        /*
                         * printf("calling %p, for key = '%s' and value = * '%s'\n",
-                        *        item->callback, key, value);
+                        *        item->callback, key, value);
                         */
                        result = item->callback(session, value);
                        if (!result)
@@ -351,20 +343,21 @@ void bti_parse_configfile(struct session *session)
                 * marker if it occurs at the beginning of the line, or after
                 * whitespace
                 */
-               hashmarker = strchrnul(line, '#');
+               hashmarker = strchr(line, '#');
                if (line == hashmarker)
                        line[0] = '\0';
                else {
-                       while (hashmarker[0] != '\0') {
+                       while (hashmarker != NULL) {
                                --hashmarker;
-                               if (isblank(hashmarker[0]))
+                               if (isblank(hashmarker[0])) {
                                        hashmarker[0] = '\0';
-                               else {
+                                       break;
+                               } else {
                                        /*
                                         * false positive; '#' occured
                                         * within a string
                                         */
-                                       hashmarker = strchrnul(hashmarker+2, '#');
+                                       hashmarker = strchr(hashmarker+2, '#');
                                }
                        }
                }