*/
#define NO_SHORTNAMES /* Tell config not to load remap.h */
-#include <../src/config.h>
+#include <config.h>
+
+/* defined to be emacs_main, sys_fopen, etc. in config.h */
+#undef main
+#undef fopen
+#undef chdir
#include <stdio.h>
#ifdef MSDOS
if (c == '\\')
{
c = getc (infile);
- if (c == '\n')
+ if (c == '\n' || c == '\r')
{
c = getc (infile);
continue;
c = '\n';
while (!feof (infile))
{
- if (c != '\n')
+ if (c != '\n' && c != '\r')
{
c = getc (infile);
continue;
{
do
c = getc (infile);
- while (c == ' ' || c == '\n' || c == '\t');
+ while (c == ' ' || c == '\n' || c == '\r' || c == '\t');
if (c < 0)
goto eof;
ungetc (c, infile);
goto eof;
c = getc (infile);
}
- while (c == ' ' || c == '\n' || c == '\t')
+ while (c == ' ' || c == '\n' || c == '\r' || c == '\t')
c = getc (infile);
if (c == '"')
c = read_c_string (infile, 0);
while (c != ',')
c = getc (infile);
c = getc (infile);
- while (c == ' ' || c == '\n' || c == '\t')
+ while (c == ' ' || c == '\n' || c == '\r' || c == '\t')
c = getc (infile);
if (c == '"')
FILE *infile;
{
char c = ' ';
- while (c == ' ' || c == '\t' || c == '\n')
+ while (c == ' ' || c == '\t' || c == '\n' || c == '\r')
c = getc (infile);
ungetc (c, infile);
}
c = getc (infile);
if (c == '\\')
*(++fillp) = getc (infile);
- else if (c == ' ' || c == '\t' || c == '\n' || c == '(' || c == ')')
+ else if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '(' || c == ')')
{
ungetc (c, infile);
*fillp = 0;
char buffer[BUFSIZ];
char type;
- if (c != '\n')
+ if (c != '\n' && c != '\r')
{
c = getc (infile);
continue;
saved_string[length - 1] = 0;
/* Skip the newline. */
c = getc (infile);
- while (c != '\n')
+ while (c != '\n' && c != '\r')
c = getc (infile);
}
continue;
*/
if ((c = getc (infile)) != '"' ||
(c = getc (infile)) != '\\' ||
- (c = getc (infile)) != '\n')
+ (c = getc (infile)) != '\n' || c != '\r')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
{
/* Skip until the first newline; remember the two previous chars. */
- while (c != '\n' && c >= 0)
+ while (c != '\n' && c != '\r' && c >= 0)
{
c2 = c1;
c1 = c;
{
/* Skip until the first newline; remember the two previous
chars. */
- while (c != '\n' && c >= 0)
+ while (c != '\n' && c != '\r' && c >= 0)
{
c2 = c1;
c1 = c;
if (saved_string == 0)
{
/* Skip until the first newline; remember the two previous chars. */
- while (c != '\n' && c >= 0)
+ while (c != '\n' && c != '\r' && c >= 0)
{
c2 = c1;
c1 = c;
then we're not reading a docstring. */
if ((c = getc (infile)) != '"' ||
(c = getc (infile)) != '\\' ||
- (c = getc (infile)) != '\n')
+ (c = getc (infile)) != '\n' || c != '\r')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",