Import upstream version 2.12.c.5
Kali Janitor
3 years ago
7 | 7 | PointerBindsToType: false |
8 | 8 | ColumnLimit: 0 |
9 | 9 | SpaceBeforeParens: ControlStatements |
10 | SortIncludes: false |
0 | 0 | name: Build Test |
1 | 1 | |
2 | on: | |
3 | push: | |
4 | branches: [ master ] | |
5 | pull_request: | |
6 | branches: [ master ] | |
7 | ||
2 | on: [push, pull_request] | |
8 | 3 | jobs: |
9 | 4 | build: |
10 | ||
11 | 5 | runs-on: ubuntu-latest |
12 | ||
13 | 6 | steps: |
14 | 7 | - uses: actions/checkout@v2 |
15 | - name: Install dependencies | |
8 | - name: Install deps | |
16 | 9 | run: sudo apt install pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util-dev libxcb-xrm-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev |
17 | - name: autoreconf | |
18 | run: autoreconf -fiv | |
19 | - name: configure | |
20 | run: ./configure --prefix=/usr --sysconfdir=/etc | |
21 | - name: make | |
22 | run: make | |
23 | - name: make check | |
24 | run: make check | |
25 | - name: make distcheck | |
26 | run: make distcheck | |
10 | - run: chmod +x build.sh | |
11 | - run: ./build.sh | |
12 | - run: cd build && make check | |
13 | - run: cd build && make distcheck | |
14 | - name: Upload binary artifact | |
15 | uses: actions/upload-artifact@v2 | |
16 | with: | |
17 | name: i3lock | |
18 | path: /home/runner/work/i3lock-color/i3lock-color/build/i3lock |
2 | 2 | tags |
3 | 3 | *.swp |
4 | 4 | *.gz |
5 | /pam/i3lock | |
5 | 6 | |
6 | 7 | ################################################################################ |
7 | 8 | # https://raw.githubusercontent.com/github/gitignore/master/Autotools.gitignore |
29 | 30 | /install-sh |
30 | 31 | /missing |
31 | 32 | /stamp-h1 |
33 | *.in~ | |
34 | pam/i3lock |
6 | 6 | compiler: |
7 | 7 | - gcc |
8 | 8 | - clang |
9 | addons: | |
10 | apt: | |
11 | packages: | |
12 | - clang-format-3.5 | |
13 | 9 | script: |
14 | - clang-format-3.5 -i *.[ch] && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false) | |
15 | 10 | - docker build --pull --no-cache --rm -t=i3lock -f travis/Dockerfile . |
11 | - docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'clang-format-9 -i *.[ch] && git diff --exit-code || (echo "Code was not formatted using clang-format!"; false)' | |
16 | 12 | - docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j V=1 CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror"' |
0 | 0 | Copyright © 2010-2011, Michael Stapelberg |
1 | 1 | Copyright © 2015, Cassandra Fox |
2 | Copyright © 2015, Raymond Li | |
2 | Copyright © 2020, Raymond Li | |
3 | 3 | All rights reserved. |
4 | 4 | |
5 | 5 | Redistribution and use in source and binary forms, with or without |
60 | 60 | ### Ubuntu 18.04 LTS |
61 | 61 | Run this command to install all dependencies: |
62 | 62 | ``` |
63 | sudo apt install pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util-dev libxcb-xrm-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev | |
63 | sudo apt install autoconf gcc make pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util-dev libxcb-xrm-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev | |
64 | 64 | ``` |
65 | 65 | |
66 | 66 | ## Arch Linux |
67 | 67 | - autoconf |
68 | 68 | - cairo |
69 | 69 | - fontconfig |
70 | - gcc | |
70 | 71 | - libev |
71 | 72 | - libjpeg-turbo |
72 | 73 | - libxinerama |
84 | 85 | |
85 | 86 | **If you want to build a non-debug version, you should tag your build before configuring.** For example: `git tag -f "git-$(git rev-parse --short HEAD)"` will add a tag with the short commit ID, which will be used for the version info. Issues asking about ASAN/complaints about i3lock-color being slow / etc will likely be closed. i3lock-color uses GNU autotools for building. |
86 | 87 | |
87 | To build i3lock-color, first install the dependencies listed above, then run: | |
88 | To use i3lock-color, first install the dependencies listed above, then clone the repo: | |
88 | 89 | ``` |
89 | chmod +x make.sh | |
90 | ./make.sh | |
90 | git clone https://github.com/Raymo111/i3lock-color.git | |
91 | cd i3lock-color | |
92 | ``` | |
93 | To build without installing, run: | |
94 | ``` | |
95 | chmod +x build.sh | |
96 | ./build.sh | |
97 | ``` | |
98 | To install after building, run: | |
99 | ``` | |
100 | chmod +x install-i3lock-color.sh | |
101 | ./install-i3lock-color.sh | |
91 | 102 | ``` |
92 | 103 | You may choose to modify the script based on your needs/OS/distro. |
93 | 104 |
0 | 0 | #!/bin/bash |
1 | 1 | autoreconf -fiv |
2 | 2 | |
3 | rm -rf build/ | |
4 | mkdir -p build && cd build/ | |
3 | BUILD_DIR=build/ | |
4 | rm -rf $BUILD_DIR | |
5 | mkdir -vp $BUILD_DIR | |
6 | cd $BUILD_DIR || { echo "cd $BUILD_DIR"; exit 127; } | |
5 | 7 | |
6 | ../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers | |
8 | ../configure --prefix=/usr --sysconfdir=/etc | |
7 | 9 | |
8 | 10 | make |
1 | 1 | # Run autoreconf -fi to generate a configure script from this file. |
2 | 2 | |
3 | 3 | AC_PREREQ([2.69]) |
4 | AC_INIT([i3lock-color], [2.12.c.1], [https://github.com/Raymo11/i3lock-color/issues]) | |
4 | AC_INIT([i3lock-color], [m4_esyscmd_s([cat I3LOCK_VERSION])], [https://github.com/Raymo11/i3lock-color/issues]) | |
5 | 5 | # For AX_EXTEND_SRCDIR |
6 | 6 | AX_ENABLE_BUILDDIR |
7 | 7 | AM_INIT_AUTOMAKE([foreign subdir-objects -Wall no-dist-gzip dist-bzip2]) |
65 | 65 | AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK |
66 | 66 | AC_FUNC_STRNLEN |
67 | 67 | AC_CHECK_FUNCS([atexit dup2 ftruncate getcwd gettimeofday localtime_r memchr memset mkdir rmdir setlocale socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr strtol strtoul], , [AC_MSG_FAILURE([cannot find the $ac_func function, which i3lock requires])]) |
68 | AC_CHECK_FUNCS([explicit_bzero]) | |
68 | 69 | |
69 | 70 | # Checks for libraries. |
70 | 71 | |
74 | 75 | AC_SEARCH_LIBS([ev_run], [ev], , [AC_MSG_FAILURE([cannot find the required ev_run() function despite trying to link with -lev])]) |
75 | 76 | |
76 | 77 | AC_SEARCH_LIBS([shm_open], [rt]) |
78 | ||
79 | # Use system-auth instead of login on Arch (TODO: Implement Gentoo as well) | |
80 | if [[ -f /etc/arch-release ]]; then | |
81 | echo "Using PAM for Arch" | |
82 | sed -i "s/^#auth include system-auth/auth include system-auth/g" ../pam/i3lock | |
83 | sed -i "s/^auth include login/#auth include login/g" ../pam/i3lock | |
84 | fi | |
77 | 85 | |
78 | 86 | # Only disable PAM on OpenBSD where i3lock uses BSD Auth instead |
79 | 87 | case "$host" in |
7 | 7 | .fi |
8 | 8 | .. |
9 | 9 | |
10 | .TH i3lock-color 1 "JANUARY 2012" Linux "User Manuals" | |
10 | .TH i3lock-color 1 "JULY 2020" Linux "User Manuals" | |
11 | 11 | |
12 | 12 | .SH NAME |
13 | 13 | i3lock-color \- improved screen locker |
106 | 106 | .BI \-c\ rrggbbaa \fR,\ \fB\-\-color= rrggbbaa |
107 | 107 | Turn the screen into the given color instead of white. Color must be given in 4-byte |
108 | 108 | format: rrggbbaa (i.e. ff0000ff is opaque red). |
109 | Use the last byte for alpha. Setting this below FF (i.e. ff000088) will allow your screen to be shown translucently if you use a compositor (e.g. compton, xcompmgr). | |
109 | Use the last byte for alpha. Setting this below FF (i.e. ff000088) will allow your screen to be shown translucently if you use a compositor (e.g. compton, xcompmgr). | |
110 | 110 | |
111 | 111 | .TP |
112 | 112 | .B \-t, \-\-tiling |
147 | 147 | |
148 | 148 | .SH i3lock-color options |
149 | 149 | .TP |
150 | .B \-S=number, \-\-screen=number | |
150 | .B \-S number, \-\-screen=number | |
151 | 151 | Specifies which display to draw the unlock indicator and clock on. By default, they'll be placed on every screen. |
152 | 152 | Note that this number is zero indexed. The ordering is dependent on libxinerama. |
153 | 153 | |
154 | 154 | .TP |
155 | .B \-B=sigma, \-\-blur=sigma | |
155 | .B \-B sigma, \-\-blur=sigma | |
156 | 156 | Captures the screen and blurs it using the given sigma (radius). |
157 | 157 | Images may still be overlaid over the blurred screenshot. |
158 | 158 | As an alternative to this option, you could specify a translucent background color |
197 | 197 | .B \-\-pass\-power\-keys |
198 | 198 | Allow the following keys to be used while the screen is locked by passing them through: |
199 | 199 | XF86PowerDown, XF86PowerOff, XF86Sleep. |
200 | ||
201 | .TP | |
202 | .B \-\-pass\-volume\-keys | |
203 | Allow the following keys to be used while the screen is locked by passing them through: | |
204 | XF86AudioMute, XF86AudioLowerVolume, XF86AudioRaiseVolume. | |
200 | 205 | |
201 | 206 | .TP |
202 | 207 | .B \-\-insidevercolor=rrggbbaa |
336 | 341 | |
337 | 342 | .TP |
338 | 343 | .B \-\-greeterpos="x position:y position" |
339 | Sets the position for the date string. All the variables from \-\-indpos and \-\-timepos may be used. | |
344 | Sets the position for the greeter string. All the variables from \-\-indpos and \-\-timepos may be used. | |
340 | 345 | |
341 | 346 | .TP |
342 | 347 | .B \-\-refresh\-rate=seconds\-as\-double |
458 | 463 | |
459 | 464 | Pandora <pandora at techfo dot xyz> |
460 | 465 | |
461 | Raymond Li <hi at raymond.li> | |
466 | Raymond Li <i3lock-color at raymond.li> |
2 | 2 | * |
3 | 3 | * © 2010 Michael Stapelberg |
4 | 4 | * © 2015 Cassandra Fox |
5 | * © 2020 Raymond Li | |
5 | 6 | * |
6 | 7 | * See LICENSE for licensing information |
7 | 8 | * |
16 | 17 | #include <stdlib.h> |
17 | 18 | #include <pwd.h> |
18 | 19 | #include <sys/types.h> |
19 | #include <string.h> | |
20 | 20 | #include <dirent.h> |
21 | 21 | #include <unistd.h> |
22 | 22 | #include <stdbool.h> |
43 | 43 | #include <xkbcommon/xkbcommon-x11.h> |
44 | 44 | #include <cairo.h> |
45 | 45 | #include <cairo/cairo-xcb.h> |
46 | #ifdef __OpenBSD__ | |
46 | #ifdef HAVE_EXPLICIT_BZERO | |
47 | 47 | #include <strings.h> /* explicit_bzero(3) */ |
48 | 48 | #endif |
49 | 49 | #include <xcb/xcb_aux.h> |
234 | 234 | bool pass_media_keys = false; |
235 | 235 | bool pass_screen_keys = false; |
236 | 236 | bool pass_power_keys = false; |
237 | bool pass_volume_keys = false; | |
237 | 238 | |
238 | 239 | // for the rendering thread, so we can clean it up |
239 | 240 | pthread_t draw_thread; |
402 | 403 | * |
403 | 404 | */ |
404 | 405 | static void clear_password_memory(void) { |
405 | #ifdef __OpenBSD__ | |
406 | #ifdef HAVE_EXPLICIT_BZERO | |
406 | 407 | /* Use explicit_bzero(3) which was explicitly designed not to be |
407 | 408 | * optimized out by the compiler. */ |
408 | 409 | explicit_bzero(password, strlen(password)); |
693 | 694 | case XKB_KEY_XF86PowerDown: |
694 | 695 | case XKB_KEY_XF86PowerOff: |
695 | 696 | case XKB_KEY_XF86Sleep: |
697 | xcb_send_event(conn, true, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, (char *)event); | |
698 | return; | |
699 | } | |
700 | } | |
701 | ||
702 | // volume keys | |
703 | if (pass_volume_keys) { | |
704 | switch(ksym) { | |
705 | case XKB_KEY_XF86AudioMute: | |
706 | case XKB_KEY_XF86AudioLowerVolume: | |
707 | case XKB_KEY_XF86AudioRaiseVolume: | |
696 | 708 | xcb_send_event(conn, true, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, (char *)event); |
697 | 709 | return; |
698 | 710 | } |
880 | 892 | event->state_notify.baseGroup, |
881 | 893 | event->state_notify.latchedGroup, |
882 | 894 | event->state_notify.lockedGroup); |
895 | layout_text = get_keylayoutname(keylayout_mode, conn); | |
896 | redraw_screen(); | |
883 | 897 | break; |
884 | 898 | } |
885 | 899 | } |
890 | 904 | * and also redraw the image, if any. |
891 | 905 | * |
892 | 906 | */ |
893 | void handle_screen_resize(void) { | |
907 | static void handle_screen_resize(void) { | |
894 | 908 | xcb_get_geometry_cookie_t geomc; |
895 | 909 | xcb_get_geometry_reply_t *geom; |
896 | 910 | geomc = xcb_get_geometry(conn, screen->root); |
1465 | 1479 | {"pass-media-keys", no_argument, NULL, 601}, |
1466 | 1480 | {"pass-screen-keys", no_argument, NULL, 602}, |
1467 | 1481 | {"pass-power-keys", no_argument, NULL, 603}, |
1482 | {"pass-volume-keys", no_argument, NULL, 604}, | |
1468 | 1483 | |
1469 | 1484 | // bar indicator stuff |
1470 | 1485 | {"bar-indicator", no_argument, NULL, 700}, |
1498 | 1513 | char *optstring = "hvnbdc:p:ui:tCeI:frsS:kB:m"; |
1499 | 1514 | char *arg = NULL; |
1500 | 1515 | int opt = 0; |
1516 | char padded[9] = "ffffffff"; \ | |
1501 | 1517 | |
1502 | 1518 | #define parse_color(acolor)\ |
1503 | 1519 | arg = optarg;\ |
1504 | 1520 | if (arg[0] == '#') arg++;\ |
1505 | 1521 | if (strlen(arg) == 6) {\ |
1506 | 1522 | /* If 6 digits given, assume RGB and pad 0xff for alpha */\ |
1507 | char padded[9] = "ffffffff"; \ | |
1508 | 1523 | strncpy( padded, arg, 6 );\ |
1509 | 1524 | arg = padded;\ |
1510 | 1525 | }\ |
1514 | 1529 | while ((o = getopt_long(argc, argv, optstring, longopts, &longoptind)) != -1) { |
1515 | 1530 | switch (o) { |
1516 | 1531 | case 'v': |
1517 | errx(EXIT_SUCCESS, "version " I3LOCK_VERSION " © 2010 Michael Stapelberg, © 2015 Cassandra Fox"); | |
1532 | errx(EXIT_SUCCESS, "version " I3LOCK_VERSION " © 2010 Michael Stapelberg, © 2015 Cassandra Fox, © 2020 Raymond Li"); | |
1518 | 1533 | case 'n': |
1519 | 1534 | dont_fork = true; |
1520 | 1535 | break; |
1587 | 1602 | |
1588 | 1603 | // Begin colors |
1589 | 1604 | case 'c': |
1590 | parse_color(color); | |
1605 | parse_color(color); | |
1591 | 1606 | break; |
1592 | 1607 | case 300: |
1593 | 1608 | parse_color(insidevercolor); |
1940 | 1955 | break; |
1941 | 1956 | case 603: |
1942 | 1957 | pass_power_keys = true; |
1958 | break; | |
1959 | case 604: | |
1960 | pass_volume_keys = true; | |
1943 | 1961 | break; |
1944 | 1962 | |
1945 | 1963 | // Bar indicator |
7 | 7 | * This is important because xautolock (for example) closes stdout/stderr by |
8 | 8 | * default, so just printing something to stdout will lead to the data ending |
9 | 9 | * up on the X11 socket (!). */ |
10 | #define DEBUG(fmt, ...) \ | |
11 | do { \ | |
12 | if (debug_mode) \ | |
13 | printf("[i3lock-debug] " fmt, ##__VA_ARGS__); \ | |
10 | #define DEBUG(fmt, ...) \ | |
11 | do { \ | |
12 | if (debug_mode) { \ | |
13 | fprintf(stderr, "[i3lock-debug] " fmt, ##__VA_ARGS__); \ | |
14 | } \ | |
14 | 15 | } while (0) |
15 | 16 | |
16 | 17 | #endif |
0 | #!/bin/bash | |
1 | ./build.sh | |
2 | ||
3 | sudo make install | |
4 | ||
5 | sudo install -Dm644 ../LICENSE "/usr/share/licenses/i3lock-color/LICENSE" |
62 | 62 | # LICENSE |
63 | 63 | # |
64 | 64 | # Copyright (c) 2016 Michael Stapelberg <[email protected]> |
65 | # Copyright (c) 2020 Raymond Li <[email protected]> | |
65 | 66 | # |
66 | 67 | # Copying and distribution of this file, with or without modification, are |
67 | 68 | # permitted in any medium without royalty provided the copyright notice |
68 | 68 | # LICENSE |
69 | 69 | # |
70 | 70 | # Copyright (c) 2016 Michael Stapelberg <[email protected]> |
71 | # Copyright (c) 2020 Raymond Li <[email protected]> | |
71 | 72 | # |
72 | 73 | # Copying and distribution of this file, with or without modification, |
73 | 74 | # are permitted in any medium without royalty provided the copyright |
0 | 0 | # |
1 | # PAM configuration file for the i3lock screen locker. By default, it includes | |
2 | # the 'login' configuration file (see /etc/pam.d/login) | |
1 | # PAM configuration file for the i3lock-color screen locker. By default, it includes | |
2 | # the 'system-auth' configuration file (see /etc/pam.d/system-auth) for Arch and Gentoo | |
3 | # and 'login' for Debian. Note that vanilla i3lock upstream uses 'login' instead. | |
3 | 4 | # |
4 | 5 | |
5 | auth include login | |
6 | #auth include system-auth # For Arch/Gentoo | |
7 | auth include login # For Debian |
1 | 1 | * vim:ts=4:sw=4:expandtab |
2 | 2 | * |
3 | 3 | * © 2010 Michael Stapelberg |
4 | * © 2020 Raymond Li | |
4 | 5 | * |
5 | 6 | * See LICENSE for licensing information |
6 | 7 | * |
10 | 10 | # (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now. |
11 | 11 | |
12 | 12 | # Install mk-build-deps (for installing the i3 build dependencies), |
13 | # clang and clang-format-3.8 (for checking formatting and building with clang), | |
13 | # clang and clang-format-9 (for checking formatting and building with clang), | |
14 | 14 | # lintian (for checking spelling errors), |
15 | 15 | # test suite dependencies (for running tests) |
16 | 16 | RUN apt-get update && \ |
18 | 18 | build-essential clang git autoconf automake libxcb-randr0-dev pkg-config libpam0g-dev \ |
19 | 19 | libcairo2-dev libxcb1-dev libxcb-dpms0-dev libxcb-image0-dev libxcb-util0-dev \ |
20 | 20 | libxcb-xrm-dev libev-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev \ |
21 | libxkbcommon-x11-dev && \ | |
21 | libxkbcommon-x11-dev clang-format-9 && \ | |
22 | 22 | rm -rf /var/lib/apt/lists/* |
23 | 23 | |
24 | 24 | WORKDIR /usr/src |
1 | 1 | * vim:ts=4:sw=4:expandtab |
2 | 2 | * |
3 | 3 | * © 2010 Michael Stapelberg |
4 | * © 2010 Cassandra Fox | |
4 | * © 2015 Cassandra Fox | |
5 | * © 2020 Raymond Li | |
5 | 6 | * |
6 | 7 | * See LICENSE for licensing information |
7 | 8 | * |
895 | 896 | screen_number = 0; |
896 | 897 | } |
897 | 898 | |
899 | DEBUG("Drawing indicator on %d screens\n", screen_number); | |
900 | ||
898 | 901 | int current_screen = screen_number == 0 ? 0 : screen_number - 1; |
899 | 902 | const int end_screen = screen_number == 0 ? xr_screens : screen_number; |
900 | 903 | for (; current_screen < end_screen; current_screen++) { |
0 | 0 | /* |
1 | 1 | * vim:ts=4:sw=4:expandtab |
2 | 2 | * |
3 | * © 2010 Michael Stapelberg | |
3 | * © 2010 Michael | |
4 | * @ © 2020 Raymond Li | |
4 | 5 | * |
5 | 6 | * xcb.c: contains all functions which use XCB to talk to X11. Mostly wrappers |
6 | 7 | * around the rather complicated/ugly parts of the XCB API. |
535 | 536 | } |
536 | 537 | |
537 | 538 | |
539 | uint8_t xcb_get_key_group_index(xcb_connection_t *conn) { | |
540 | xcb_xkb_get_state_cookie_t cookie; | |
541 | xcb_xkb_get_state_reply_t* reply = NULL; | |
542 | cookie = xcb_xkb_get_state(conn, XCB_XKB_ID_USE_CORE_KBD); | |
543 | reply = xcb_xkb_get_state_reply(conn, cookie, NULL); | |
544 | uint8_t ans = reply->group; | |
545 | free(reply); | |
546 | return ans; | |
547 | } | |
548 | ||
549 | ||
538 | 550 | char* xcb_get_key_group_names(xcb_connection_t *conn) { |
539 | 551 | uint8_t xkb_base_event; |
540 | 552 | uint8_t xkb_base_error; |
583 | 595 | |
584 | 596 | int length; |
585 | 597 | xcb_atom_t *iter; |
598 | uint8_t index; | |
586 | 599 | char* answer = NULL; |
587 | 600 | length = xcb_xkb_get_names_value_list_groups_length(reply, &list); |
588 | 601 | iter = xcb_xkb_get_names_value_list_groups(&list); |
602 | index = xcb_get_key_group_index(conn); | |
589 | 603 | |
590 | 604 | for (int i = 0; i < length; i++) { |
591 | 605 | xcb_atom_t group_name = *iter; |
592 | 606 | char* name = get_atom_name(conn, group_name); |
593 | 607 | DEBUG("group_name %d: %s\n", i, name); |
594 | if (i == 0) { | |
608 | if (i == index) { | |
595 | 609 | answer = name; |
596 | 610 | } else { |
597 | 611 | free(name); |