]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/bootstrap/server/src/module.c
5f09290799188cfecbca2ae87982f6a34a3628e7
[l4.git] / l4 / pkg / bootstrap / server / src / module.c
1 /*
2  * (c) 2008-2009 Technische Universität Dresden
3  * This file is part of TUD:OS and distributed under the terms of the
4  * GNU General Public License 2.
5  * Please see the COPYING-GPL-2 file for details.
6  */
7 #include <stdio.h>
8 #include "module.h"
9
10 void
11 print_module_name(const char *name, const char *alt_name)
12 {
13   const char *c1, *c2;
14
15   if (!name)
16     {
17       printf("%s", alt_name);
18       return;
19     }
20
21   c2 = name;
22   while (*c2 != '\0' && *c2 != ' ')
23     c2++;
24   c1 = c2;
25   if (c1 > name)
26     c1--;
27   while (c1 > name && c2-c1 < 56)
28     c1--;
29
30   printf("%.*s", (unsigned)(c2-c1), c1);
31 }