Go to the documentation of this file.00001
00017 #include <ctype.h>
00018 #include <string.h>
00019 #include <grass/gis.h>
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00045 char *G_squeeze(char *line)
00046 {
00047 register char *f = line, *t = line;
00048 int l;
00049
00050
00051 while (isspace(*f))
00052 f++;
00053
00054 while (*f)
00055 if (!isspace(*f))
00056 *t++ = *f++;
00057 else if (*++f)
00058 if (!isspace(*f))
00059 *t++ = ' ';
00060 *t = '\0';
00061 l = strlen(line) - 1;
00062 if (*(line + l) == '\n')
00063 *(line + l) = '\0';
00064
00065 return line;
00066 }