str.c (67429) | str.c (74699) |
---|---|
1#ifndef lint 2static const char rcsid[] = | 1#ifndef lint 2static const char rcsid[] = |
3 "$FreeBSD: head/usr.sbin/pkg_install/lib/str.c 67429 2000-10-22 09:53:27Z jkh $"; | 3 "$FreeBSD: head/usr.sbin/pkg_install/lib/str.c 74699 2001-03-23 18:45:24Z sobomax $"; |
4#endif 5 6/* 7 * FreeBSD install - a package for the installation and maintainance 8 * of non-core utilities. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions --- 92 unchanged lines hidden (view full) --- 104void 105str_lowercase(char *str) 106{ 107 while (*str) { 108 *str = tolower(*str); 109 ++str; 110 } 111} | 4#endif 5 6/* 7 * FreeBSD install - a package for the installation and maintainance 8 * of non-core utilities. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions --- 92 unchanged lines hidden (view full) --- 104void 105str_lowercase(char *str) 106{ 107 while (*str) { 108 *str = tolower(*str); 109 ++str; 110 } 111} |
112 113char * 114get_string(char *str, int max, FILE *fp) 115{ 116 int len; 117 118 if (!str) 119 return NULL; 120 str[0] = '\0'; 121 while (fgets(str, max, fp)) { 122 len = strlen(str); 123 while (len && isspace(str[len - 1])) 124 str[--len] = '\0'; 125 if (len) 126 return str; 127 } 128 return NULL; 129} 130 |
|