summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2016-08-15 08:40:46 +0200
committerRémi Verschelde <rverschelde@gmail.com>2016-08-15 08:40:46 +0200
commit973f0a2b8e836c1bb2c6a1bc9eebfefc8d3ceb22 (patch)
tree5cd11b0a75026d8e29eebaaf078ef1d1461f1832
parent90367d3795176a14429f0f8f40924caa384db6d8 (diff)
downloadtheme-973f0a2b8e836c1bb2c6a1bc9eebfefc8d3ceb22.tar
theme-973f0a2b8e836c1bb2c6a1bc9eebfefc8d3ceb22.tar.gz
theme-973f0a2b8e836c1bb2c6a1bc9eebfefc8d3ceb22.tar.bz2
theme-973f0a2b8e836c1bb2c6a1bc9eebfefc8d3ceb22.tar.xz
theme-973f0a2b8e836c1bb2c6a1bc9eebfefc8d3ceb22.zip
Makefile: Rename to "theme" to match gitweb snapshot on export
Also dropped unused PACKAGE constant.
-rw-r--r--Makefile5
1 files changed, 2 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 9f9cb2b..ec5b1d7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,4 @@
-NAME=mageia-theme
-PACKAGE=mageia-theme
+NAME=theme
VERSION=1.5.0.51
THEMES=Mageia-Default
@@ -53,7 +52,7 @@ install:
dist: cleandist export
cleandist:
- rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.xz
+ rm -rf $(NAME)-$(VERSION) $(NAME)-$(VERSION).tar.xz
export:
git archive --prefix $(NAME)-$(VERSION)/ HEAD | xz -9 > $(NAME)-$(VERSION).tar.xz
id='n49' href='#n49'>49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
#include <pwd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <paths.h>
#include <string.h>
#include "parselib.h"

static struct state __ps;

void setpwent(void) {
  __prepare_parse(_PATH_PASSWD,&__ps);
}

void endpwent(void) {
  __end_parse(&__ps);
}

int getpwent_r(struct passwd *res, char *buf, size_t buflen,
	       struct passwd **res_sig) {
  size_t i,j,n;
  unsigned long l;
  if (!__ps.buffirst) setpwent();
  if (!__ps.buffirst) goto error;
  if (__ps.cur>=__ps.buflen) goto error;
again:
  n=0;
  for (i=0; i<7; ++i) {
    j=__parse_1(&__ps,':');
    if (__ps.buffirst[__ps.cur+j]!=':' && i<6) {
parseerror:
      while (__ps.cur+j<__ps.buflen) {
	if (__ps.buffirst[__ps.cur+j]=='\n') {
	  __ps.cur+=j+1;
	  goto again;
	}
	++j;
      }
    }
    switch (i) {
    case 0:
      res->pw_name=buf+n;
copy:
      if ((size_t)buflen<=n+j) goto error;
      memcpy(buf+n,__ps.buffirst+__ps.cur,j);
      buf[n+j]=0;
      n+=j+1;
      break;
    case 1: res->pw_passwd=buf+n; goto copy;
    case 4: res->pw_gecos=buf+n; goto copy;
    case 5: res->pw_dir=buf+n; goto copy;
    case 6: res->pw_shell=buf+n; goto copy;
    case 2:
    case 3:
	    if (scan_ulong(__ps.buffirst+__ps.cur,&l)!=j) goto parseerror;
	    if (i==2) res->pw_uid=l; else res->pw_gid=l;
	    break;
    }
    __ps.cur+=j+1;
  }
  *res_sig=res;
  return 0;
error:
  *res_sig=0;/* the glibc people should be taken behind the barn and shot */
  return -1;
}