X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fwrite_entry.c;h=b2edd5d9e63993b13c110d3593021f9d9c1b5e5a;hp=931a0b6addb08e92561c345c0521fb6a7446d302;hb=b8cca229aaa89adcc41dbd7c7710515e983e60f2;hpb=e2dee48666d83c609f7ecced6203ecfdc94e36aa;ds=sidebyside diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index 931a0b6a..b2edd5d9 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -47,7 +47,7 @@ #define TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.89 2013/09/28 20:20:30 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.92 2014/11/01 14:47:00 tom Exp $") static int total_written; @@ -93,7 +93,7 @@ check_writeable(int code) char dir[sizeof(LEAF_FMT)]; char *s = 0; - if (code == 0 || (s = strchr(dirnames, code)) == 0) + if (code == 0 || (s = (strchr) (dirnames, code)) == 0) _nc_err_abort("Illegal terminfo subdirectory \"" LEAF_FMT "\"", code); if (verified[s - dirnames]) @@ -185,13 +185,16 @@ make_db_root(const char *path) * Set the write directory for compiled entries. */ NCURSES_EXPORT(void) -_nc_set_writedir(char *dir) +_nc_set_writedir(const char *dir) { const char *destination; char actual[PATH_MAX]; if (dir == 0 - && use_terminfo_vars()) +#ifndef USE_ROOT_ENVIRON + && use_terminfo_vars() +#endif + ) dir = getenv("TERMINFO"); if (dir != 0)