home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make server config files more readable, their parsing more lenient.
[plomrogue]
/
src
/
common
/
readwrite.c
diff --git
a/src/common/readwrite.c
b/src/common/readwrite.c
index 026c9add7aba8e5434f158bb97c765d957d88d55..a0ab3f7cf5ccfef0f7bc7350a5066aa3df13c623 100644
(file)
--- a/
src/common/readwrite.c
+++ b/
src/common/readwrite.c
@@
-95,12
+95,11
@@
extern void try_fclose_unlink_rename(FILE * file, char * p1, char * p2,
-extern uint32_t textfile_
sizes(FILE * file, uint32_t * n_lines_p
)
+extern uint32_t textfile_
width(FILE * file
)
{
{
- char * f_name = "textfile_
sizes
()";
+ char * f_name = "textfile_
width
()";
int c = 0;
uint32_t c_count = 0;
int c = 0;
uint32_t c_count = 0;
- uint32_t n_lines = 0;
uint32_t linemax = 0;
while (1)
{
uint32_t linemax = 0;
while (1)
{
@@
-117,10
+116,6
@@
extern uint32_t textfile_sizes(FILE * file, uint32_t * n_lines_p)
linemax = c_count;
}
c_count = 0;
linemax = c_count;
}
c_count = 0;
- if (n_lines_p)
- {
- n_lines++;
- }
}
}
if (0 == linemax && 0 < c_count) /* Handle files that consist of only one */
}
}
if (0 == linemax && 0 < c_count) /* Handle files that consist of only one */
@@
-128,9
+123,5
@@
extern uint32_t textfile_sizes(FILE * file, uint32_t * n_lines_p)
linemax = c_count;
}
exit_trouble(-1 == fseek(file, 0, SEEK_SET), f_name, "fseek()");
linemax = c_count;
}
exit_trouble(-1 == fseek(file, 0, SEEK_SET), f_name, "fseek()");
- if (n_lines_p)
- {
- * n_lines_p = n_lines;
- }
return linemax;
}
return linemax;
}