diff options
| author | Erwan Velu <erwanaliasr1@gmail.com> | 2011-02-07 23:11:39 +0100 |
|---|---|---|
| committer | Erwan Velu <erwanaliasr1@gmail.com> | 2011-02-07 23:11:39 +0100 |
| commit | 6d0cfd4b044a0e8294d27921cef9a10ce2cbaa7a (patch) | |
| tree | b3ff970599742ac5065a8a95ede9293c3ffe6e1d /com32/lua | |
| parent | c030de4a10babd0b7f297ed952678676838927d4 (diff) | |
| download | syslinux-6d0cfd4b044a0e8294d27921cef9a10ce2cbaa7a.tar.gz | |
com32: single instance of skipspace()
no need to keep several versions of it.
Diffstat (limited to 'com32/lua')
| -rw-r--r-- | com32/lua/src/pci.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/com32/lua/src/pci.c b/com32/lua/src/pci.c index b9c1605e..c367ba9a 100644 --- a/com32/lua/src/pci.c +++ b/com32/lua/src/pci.c @@ -1,6 +1,7 @@ #include <stdbool.h> #include <stdlib.h> #include <string.h> +#include <ctype.h> #define lpcilib_c /* Define the library */ @@ -9,6 +10,15 @@ #include "lualib.h" #include <sys/pci.h> +/* removing any \n found in a string */ +static void remove_eol(char *string) +{ + int j = strlen(string); + int i = 0; + for (i = 0; i < j; i++) + if (string[i] == '\n') + string[i] = 0; +} static int pci_getinfo(lua_State *L) { @@ -59,24 +69,6 @@ static int pci_getinfo(lua_State *L) return 1; } -/* searching the next char that is not a space */ -static char *skipspace(char *p) -{ - while (*p && *p <= ' ') - p++; - - return p; -} - -/* removing any \n found in a string */ -static void remove_eol(char *string) -{ - int j = strlen(string); - int i = 0; - for(i = 0; i < j; i++) if(string[i] == '\n') string[i] = 0; -} - - /* Try to match any pci device to the appropriate kernel module */ /* it uses the modules.pcimap from the boot device*/ static int pci_getidlist(lua_State *L) |
