Changeset 2404c3a for functions.c


Ignore:
Timestamp:
Oct 3, 2003, 7:34:01 PM (21 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:
f933403
Parents:
87c6ef1
Message:
Added the "source" command
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rf1e629d r2404c3a  
    31593159}
    31603160
    3161 void owl_function_execstartup(void)
     3161/* Execute owl commands from the given filename.  If the filename
     3162 * is NULL, use the default owl startup commands file.
     3163 */
     3164void owl_function_source(char *filename)
    31623165{
    31633166  FILE *file;
    3164   char *filename;
    31653167  char buff[LINE];
    31663168
    3167   filename=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_STARTUP_FILE);
    3168   file=fopen(filename, "r");
    3169   owl_free(filename);
     3169  if (!filename) {
     3170    filename=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_STARTUP_FILE);
     3171    file=fopen(filename, "r");
     3172    owl_free(filename);
     3173  } else {
     3174    file=fopen(filename, "r");
     3175  }
    31703176  if (!file) {
    31713177    /* just fail silently if it doesn't exist */
Note: See TracChangeset for help on using the changeset viewer.