Changeset 74037d9 for zephyr.c


Ignore:
Timestamp:
Dec 30, 2004, 10:04:55 PM (19 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
1ef65fb
Parents:
8298425
Message:
In 'sub' command, create .zephyr.subs if it doesn't exist [BZ 15]
A fix for certain resize crashes (part from alexmv) [BZ 55]
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    rfe67f1f r74037d9  
    616616  }
    617617
    618   /* first check if it exists already */
     618  /* if the file already exists, check to see if the sub is already there */
    619619  file=fopen(subsfile, "r");
    620   if (!file) {
    621     owl_function_error("Error opening file %s", subsfile);
    622     owl_free(line);
    623     return;
    624   }
    625   while (fgets(buff, LINE, file)!=NULL) {
    626     if (!strcasecmp(buff, line)) {
    627       owl_function_error("Subscription already present in %s", subsfile);
    628       owl_free(line);
    629       return;
     620  if (file) {
     621    while (fgets(buff, LINE, file)!=NULL) {
     622      if (!strcasecmp(buff, line)) {
     623        owl_function_error("Subscription already present in %s", subsfile);
     624        owl_free(line);
     625        return;
     626      }
    630627    }
    631628  }
Note: See TracChangeset for help on using the changeset viewer.