On 10/6/14, 6:16 PM, John E. Malmberg wrote: >>> Do you mean return ""; ? >> >> Yes, good catch. It doesn't make a difference: clang and gcc both accept >> it as written and it behaves as desired. However, I'll change it for the >> next version. > > Changing it to return 0 instead of '\0' would probably be more clear. > No need to return a pointer to a static empty string.
It depends on how you want the function to work. It is nice to differentiate between the cases where there is no shell input line at all, where the index is just wrong, and the actual current input pointer. A "" indicates the second case better than a 0, though it's not perfect. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/