/****************************************************************************
- * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 1998-2014,2016 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 *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_bkgd.c,v 1.53 2019/08/17 20:59:41 tom Exp $")
+MODULE_ID("$Id: lib_bkgd.c,v 1.55 2020/03/02 01:34:48 tom Exp $")
+
+static const NCURSES_CH_T blank = NewChar(BLANK_TEXT);
/*
* Set the window's background information.
SetPair(new_bkgd, 0);
}
+ /* avoid setting background-character to a null */
+ if (CharOf(new_bkgd) == 0) {
+ NCURSES_CH_T tmp_bkgd = blank;
+ SetAttr(tmp_bkgd, AttrOf(new_bkgd));
+ SetPair(tmp_bkgd, GetPair(new_bkgd));
+ new_bkgd = tmp_bkgd;
+ }
+
memset(&old_bkgd, 0, sizeof(old_bkgd));
(void) wgetbkgrnd(win, &old_bkgd);