--- Src/hist.c.orig 2007-06-11 21:02:42.000000000 +0200 +++ Src/hist.c 2007-06-11 21:58:37.000000000 +0200 @@ -2158,6 +2158,11 @@ Histent he; zlong xcurhist = curhist - !!(histactive & HA_ACTIVE); int extended_history = isset(EXTENDEDHISTORY); + int write_file = 1; // by default assume we can write the file + + // make sure we don't write anything in case of an error + if (errno == ENOSPC) + write_file = 0; if (!interact || savehistsiz <= 0 || !hist_ring || (!fn && !(fn = getsparam("HISTFILE")))) @@ -2222,7 +2227,7 @@ #endif } } - if (out) { + if (out && write_file) { for (; he && he->histnum <= xcurhist; he = down_histent(he)) { if ((writeflags & HFILE_SKIPDUPS && he->node.flags & HIST_DUP) || (writeflags & HFILE_SKIPFOREIGN && he->node.flags & HIST_FOREIGN)