/* If the directory begins with a newline (i.e. an
* encoded null), treat it as though it's blank. */
- if (i < 0 || answer[0] == '\n') {
+ if (i < 0 || *answer == '\n') {
/* We canceled. Indicate that on the statusbar, and
* blank out ans, since we're done with it. */
statusbar(_("Cancelled"));
backupstring = NULL;
/* Cancel any search, or just return with no previous search. */
- if (i == -1 || (i < 0 && last_search[0] == '\0') ||
- (i == 0 && answer[0] == '\0')) {
+ if (i == -1 || (i < 0 && *last_search == '\0') || (i == 0 &&
+ *answer == '\0')) {
statusbar(_("Cancelled"));
return -1;
} else {
return;
/* If answer is now "", copy last_search into answer. */
- if (answer[0] == '\0')
+ if (*answer == '\0')
answer = mallocstrcpy(answer, last_search);
else
last_search = mallocstrcpy(last_search, answer);
* blank, open a new buffer instead of canceling. If the
* filename or command begins with a newline (i.e. an encoded
* null), treat it as though it's blank. */
- if (i == -1 || ((i == -2 || answer[0] == '\n')
+ if (i == -1 || ((i == -2 || *answer == '\n')
#ifdef ENABLE_MULTIBUFFER
&& !ISSET(MULTIBUFFER)
#endif
assert(name != NULL);
- if (name[0] == '\0')
+ if (*name == '\0')
return -1;
if (f_open != NULL)
sprintf(backupname, "%s%s", backup_dir, backuptemp);
free(backuptemp);
backuptemp = get_next_filename(backupname, "~");
- if (backuptemp[0] == '\0') {
+ if (*backuptemp == '\0') {
statusbar(_("Error writing %s: %s"), backupname,
_("Too many backup files?"));
free(backuptemp);
/* If the filename or command begins with a newline (i.e. an
* encoded null), treat it as though it's blank. */
- if (i < 0 || answer[0] == '\n') {
+ if (i < 0 || *answer == '\n') {
statusbar(_("Cancelled"));
retval = FALSE;
break;
assert(buf != NULL);
- if (buf[0] == '~') {
+ if (*buf == '~') {
size_t i = 1;
char *tilde_dir;
/* If the word starts with `~' and there is no slash in the word,
* then try completing this word as a username. */
- if (*place > 0 && buf[0] == '~') {
+ if (*place > 0 && *buf == '~') {
const char *bob = strchr(buf, '/');
if (bob == NULL || bob >= buf + *place)
/* If we can't save, we have really bad problems, but we might as
* well try. */
- if (die_filename[0] == '\0')
+ if (*die_filename == '\0')
die_filename = "nano";
retval = get_next_filename(die_filename, ".save");
* magichistory is set, save magichistory in
* answer. */
if ((*history_list)->next == NULL &&
- answer[0] == '\0' && magichistory != NULL) {
+ *answer == '\0' && magichistory != NULL) {
answer = mallocstrcpy(answer, magichistory);
statusbar_x = strlen(answer);
}
retval = -1;
break;
case NANO_ENTER_KEY:
- retval = (answer[0] == '\0') ? -2 : 0;
+ retval = (*answer == '\0') ? -2 : 0;
break;
}
backupstring = NULL;
/* Cancel any search, or just return with no previous search. */
- if (i == -1 || (i < 0 && last_search[0] == '\0') ||
- (!replacing && i == 0 && answer[0] == '\0')) {
+ if (i == -1 || (i < 0 && *last_search == '\0') || (!replacing &&
+ i == 0 && *answer == '\0')) {
statusbar(_("Cancelled"));
return -1;
} else {
return;
/* If answer is now "", copy last_search into answer. */
- if (answer[0] == '\0')
+ if (*answer == '\0')
answer = mallocstrcpy(answer, last_search);
else
last_search = mallocstrcpy(last_search, answer);
state = openfile->modified ? _("Modified") : ISSET(VIEW_MODE) ?
_("View") : "";
- statelen = strlenpt((state[0] == '\0' && path == NULL) ?
+ statelen = strlenpt((*state == '\0' && path == NULL) ?
_("Modified") : state);
/* If possible, add a space before state. */