X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Flinedata.h;h=b97f1c97bdd57a2d574df3dd9bdfc9059fe28187;hp=b289c44f23f1426324e1135da4bbb91227b96cf2;hb=9da7d09296c1b625afd18567a6828d8e7ec2ee01;hpb=3511767aa77f332927de0c4a610f9fb37ea18101;ds=sidebyside diff --git a/test/linedata.h b/test/linedata.h index b289c44f..b97f1c97 100644 --- a/test/linedata.h +++ b/test/linedata.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2009 Free Software Foundation, Inc. * + * Copyright (c) 2009-2012,2018 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 * @@ -26,6 +26,16 @@ * authorization. * ****************************************************************************/ +/* + * $Id: linedata.h,v 1.7 2018/02/03 22:51:43 tom Exp $ + * + * Utility functions for reading a line of text from a file. + */ +#ifndef LINEDATA_H_incl +#define LINEDATA_H_incl 1 + +#include + #define isQUIT(c) ((c) == QUIT || (c) == ESCAPE) #define key_RECUR CTRL('W') @@ -85,10 +95,8 @@ read_linedata(WINDOW *work) beep(); continue; } - } else if (code != ERR) { - result = ch; - break; } else { + result = (int) ch; break; } } @@ -98,3 +106,5 @@ read_linedata(WINDOW *work) } return result; } + +#endif /* LINEDATA_H_incl */