Changeset 1881f36


Ignore:
Timestamp:
May 18, 2011, 4:28:32 PM (10 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
963f0e3
Parents:
7865479
git-author:
Jason Gross <jgross@mit.edu> (05/17/11 13:04:53)
git-committer:
Jason Gross <jgross@mit.edu> (05/18/11 16:28:32)
Message:
owl_function_addstartup checks for file before calling owl_util_file_deleteline

This fixes trac #175: '"startup" command produces error when run for the
first time'.  The startup command deletes duplicate lines, and thus
errored when no file existed.  A check has been added to prevent this.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r7865479 r1881f36  
    32543254  filename=owl_global_get_startupfile(&g);
    32553255
    3256   /* delete earlier copies */
    3257   owl_util_file_deleteline(filename, buff, 1);
     3256  /* delete earlier copies, if the file exists */
     3257  if (g_file_test(filename, G_FILE_TEST_EXISTS))
     3258    owl_util_file_deleteline(filename, buff, 1);
    32583259
    32593260  file=fopen(filename, "a");
Note: See TracChangeset for help on using the changeset viewer.