1/*-
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Christos Zoulas of Cornell University.
7 *
8 * Redistribution and use in source and binary forms, with or without
--- 287 unchanged lines hidden (view full) ---
296 (void)snprintf(path, sizeof(path), "%s%s", ptr, elpath);
297 fname = path;
298 }
299 }
300
301 if ((fp = fopen(fname, "r")) == NULL)
302 return -1;
303
304 while ((ptr = fgetln(fp, &len)) != NULL) {
305 if (ptr[len - 1] == '\n')
306 --len;
307 ptr[len] = '\0';
308
309 if (parse_line(el, ptr) == -1) {
310 (void) fclose(fp);
311 return -1;
312 }
313 }
314
315 (void) fclose(fp);
316 return 0;
317}
318
319
320/* el_resize():
321 * Called from program when terminal is resized
--- 17 unchanged lines hidden ---
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Christos Zoulas of Cornell University.
7 *
8 * Redistribution and use in source and binary forms, with or without
--- 287 unchanged lines hidden (view full) ---
296 (void)snprintf(path, sizeof(path), "%s%s", ptr, elpath);
297 fname = path;
298 }
299 }
300
301 if ((fp = fopen(fname, "r")) == NULL)
302 return -1;
303
304 while ((ptr = fgetln(fp, &len)) != NULL) {
305 if (ptr[len - 1] == '\n')
306 --len;
307 ptr[len] = '\0';
308
309 if (parse_line(el, ptr) == -1) {
310 (void) fclose(fp);
311 return -1;
312 }
313 }
314
315 (void) fclose(fp);
316 return 0;
317}
318
319
320/* el_resize():
321 * Called from program when terminal is resized
--- 17 unchanged lines hidden ---