- while (1)
- {
- bool done;
- out = X2REALLOC (out, &out_length);
-
- /* Mark the first byte of the buffer so we can detect the case
- of nstrftime producing an empty string. Otherwise, this loop
- would not terminate when date was invoked like this
- `LANG=de date +%p' on a system with good language support. */
- out[0] = '\1';
-
- if (rfc_format)
- setlocale (LC_ALL, "C");
-
- done = (nstrftime (out, out_length, format, tm, 0, when.tv_nsec)
- || out[0] == '\0');
-
- if (rfc_format)
- setlocale (LC_ALL, "");