"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/options.c" between
feh-3.1.1.tar.bz2 and feh-3.1.2.tar.bz2

About: feh is an X11 image viewer aimed mostly at console users.

options.c  (feh-3.1.1.tar.bz2):options.c  (feh-3.1.2.tar.bz2)
skipping to change at line 134 skipping to change at line 134
return; return;
} }
static void feh_load_options_for_theme(char *theme) static void feh_load_options_for_theme(char *theme)
{ {
FILE *fp = NULL; FILE *fp = NULL;
char *home = getenv("HOME"); char *home = getenv("HOME");
char *rcpath = NULL; char *rcpath = NULL;
char *oldrcpath = NULL; char *oldrcpath = NULL;
char *confbase = getenv("XDG_CONFIG_HOME"); char *confbase = getenv("XDG_CONFIG_HOME");
// s, s1 and s2 must always have identical size
char s[1024], s1[1024], s2[1024]; char s[1024], s1[1024], s2[1024];
int cont = 0; int cont = 0;
int bspos; int bspos;
if (confbase) if (confbase)
rcpath = estrjoin("/", confbase, "feh/themes", NULL); rcpath = estrjoin("/", confbase, "feh/themes", NULL);
else if (home) else if (home)
rcpath = estrjoin("/", home, ".config/feh/themes", NULL); rcpath = estrjoin("/", home, ".config/feh/themes", NULL);
else { else {
weprintf("You have no HOME, cannot read configuration"); weprintf("You have no HOME, cannot read configuration");
skipping to change at line 170 skipping to change at line 171
if (!fp && ((fp = fopen("/etc/feh/themes", "r")) == NULL)) if (!fp && ((fp = fopen("/etc/feh/themes", "r")) == NULL))
return; return;
/* Oooh. We have an options file :) */ /* Oooh. We have an options file :) */
for (; fgets(s, sizeof(s), fp);) { for (; fgets(s, sizeof(s), fp);) {
s1[0] = '\0'; s1[0] = '\0';
s2[0] = '\0'; s2[0] = '\0';
if (cont) { if (cont) {
/*
* fgets ensures that s contains no more than 1023 charac
ters
* (+ 1 null byte)
*/
sscanf(s, " %[^\n]\n", (char *) &s2); sscanf(s, " %[^\n]\n", (char *) &s2);
if (!*s2) if (!*s2)
break; break;
D(("Got continued options %s\n", s2)); D(("Got continued options %s\n", s2));
} else { } else {
/*
* fgets ensures that s contains no more than 1023 charac
ters
* (+ 1 null byte)
*/
sscanf(s, "%s %[^\n]\n", (char *) &s1, (char *) &s2); sscanf(s, "%s %[^\n]\n", (char *) &s1, (char *) &s2);
if (!(*s1) || (!*s2) || (*s1 == '\n') || (*s1 == '#')) { if (!(*s1) || (!*s2) || (*s1 == '\n') || (*s1 == '#')) {
cont = 0; cont = 0;
continue; continue;
} }
D(("Got theme/options pair %s/%s\n", s1, s2)); D(("Got theme/options pair %s/%s\n", s1, s2));
} }
if (!strcmp(s1, theme) || cont) { if (!strcmp(s1, theme) || cont) {
skipping to change at line 464 skipping to change at line 473
break; break;
case 'C': case 'C':
D(("adding fontpath %s\n", optarg)); D(("adding fontpath %s\n", optarg));
imlib_add_path_to_font_path(optarg); imlib_add_path_to_font_path(optarg);
break; break;
case 'D': case 'D':
opt.slideshow_delay = atof(optarg); opt.slideshow_delay = atof(optarg);
if (opt.slideshow_delay < 0.0) { if (opt.slideshow_delay < 0.0) {
opt.slideshow_delay *= (-1); opt.slideshow_delay *= (-1);
opt.paused = 1; opt.paused = 1;
} else {
opt.paused = 0;
} }
break; break;
case 'E': case 'E':
opt.thumb_h = atoi(optarg); opt.thumb_h = atoi(optarg);
break; break;
case 'F': case 'F':
opt.full_screen = 1; opt.full_screen = 1;
break; break;
case 'G': case 'G':
opt.draw_actions = 1; opt.draw_actions = 1;
skipping to change at line 745 skipping to change at line 756
break; break;
#endif #endif
case 225: case 225:
opt.xinerama = 0; opt.xinerama = 0;
break; break;
case 229: case 229:
opt.text_bg = TEXT_BG_TINTED; opt.text_bg = TEXT_BG_TINTED;
break; break;
case 234: case 234:
opt.info_cmd = estrdup(optarg); opt.info_cmd = estrdup(optarg);
if (opt.info_cmd[0] == ';') if (opt.info_cmd[0] == ';') {
opt.draw_info = 0;
opt.info_cmd++; opt.info_cmd++;
else } else {
opt.draw_info = 1; opt.draw_info = 1;
}
break; break;
case 235: case 235:
opt.force_aliasing = 1; opt.force_aliasing = 1;
break; break;
case 236: case 236:
opt.no_fehbg = 1; opt.no_fehbg = 1;
break; break;
case 237: case 237:
opt.keep_zoom_vp = 1; opt.keep_zoom_vp = 1;
break; break;
skipping to change at line 828 skipping to change at line 841
char *filename_start = strrchr(target_directory, '/'); char *filename_start = strrchr(target_directory, '/');
if (filename_start) { if (filename_start) {
*filename_start = '\0'; *filename_start = '\0';
} }
add_file_to_filelist_recursively(target_directory, FILELI ST_FIRST); add_file_to_filelist_recursively(target_directory, FILELI ST_FIRST);
free(target_directory); free(target_directory);
} else { } else {
add_file_to_filelist_recursively(".", FILELIST_FIRST); add_file_to_filelist_recursively(".", FILELIST_FIRST);
} }
} }
else if (finalrun && !opt.filelistfile && !opt.bgmode)
add_file_to_filelist_recursively(".", FILELIST_FIRST);
/* So that we can safely be called again */ /* So that we can safely be called again */
optind = 0; optind = 0;
return; return;
} }
static void check_options(void) static void check_options(void)
{ {
int i; int i;
char *endptr; char *endptr;
 End of changes. 8 change blocks. 
4 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)